id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > parkourTricks
prev  |  next  |  chance

Parkour players have developed a code for listing their tricks and combinations of tricks. The code uses various letters and symbols to indicate movements such as going North 'N' or jumping 'j' or sliding 's'. You do not need to know what each symbol stands for to do this problem! Write a method that accepts a string of tricks and a positive integer for the maximum sequence of identical tricks before the run is considered boring (maxSeq). Return "Good run" if it was a good run. Return "Boring" if the run was boring because it had more than maxSeq of identical tricks in a row unless the run only had three or less tricks in which case your should return "Too short". Look at the test data for further clarification. Note that "identical tricks" refers to the same exact trick a repeated number of times... NOT the same sequence. To clarify "jjjjj" is 5 jumps in a row, which would be too many if maxSeq is 4 or less. But "NjNjNjNjNj" is not considered to be a repetition of tricks (it is instead a repetition of combinations of tricks, which is not a problem).


parkourTricks("NffsSEE", 3) → "Good run"
parkourTricks("NNNjffEEEEESSS", 8) → "Good run"
parkourTricks("NEj", 5) → "Too short"

...Save, Compile, Run (ctrl-enter)

public String parkourTricks(String tricks, int maxSeq) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 220

Copyright Nick Parlante 2017 - privacy