about | help | code help+videos | done | prefs |
Write a method that accepts a string of nothing but numeric digits. The string will have at least one character (no empty strings). The first character will indicate which digit to perform a "checksum" on. If the first digit is a "3" return the number of 3's that appear in the string EXCLUDING that first "3". If the first digit is a "7" return the number of 7's that appear in the string EXCLUDING that first "7". Look at the test data for examples. airplaneChecksum("10001000") → 1 airplaneChecksum("523325") → 1 airplaneChecksum("722535327747") → 3 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy