about | help | code help+videos | done | prefs |
Sharks swim fasta (faster) every time they eat pasta. For each occurrence of "pasta" (exact spelling and capitalization) in the string 'txt', the shark will swim one time faster. Return how many times faster the shark will swim based on the contents of 'txt'. The only string methods you are allowed to use are: .length, .equals, .substring, .charAt, and .compareTo oct31_2019_APP1SLHL_killerShark("Eat pasta!") → 1 oct31_2019_APP1SLHL_killerShark("Purple people profoundly prefer pasta, primarily") → 1 oct31_2019_APP1SLHL_killerShark("A dinner of pasta, pasta, and more pasta might just be too much pasta.") → 4 ...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