about | help | code help+videos | done | prefs |
findTheFours
FindingThe4's. Write the method that accepts a string of characters (str) and returns the count of the number of occurrences of "4". Be sure to check the string for length as if it is empty, return zero fours. Example: "ABCD4EFG" would return 1. findTheFours("AABCD4EFG") → 1 findTheFours("4A4B4C4D") → 4 findTheFours("This is fun 4 me") → 1 ...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: 101
Copyright Nick Parlante 2017 - privacy