about | help | code help+videos | done | prefs |
Write a method that USES RECURSION to create a string of paired 'left' and 'right' characters with a total number of each character equal to 'count'. For example, if 'left' is '(' and 'right' is ')' and 'count' is 5, you would return "((((()))))". Your solution MUST use recursion in a meaningful way to solve the problem. You may choose to use a helper method. You may have more than one recursive call if needed. However, remember my standing rule that you may NOT use more than one return statement per method. Look at the test data for examples. Remember, you MUST use recursion in a MEANINGFUL way to solve this problem. No loops of any kind are allowed!!! You may use one or more helper methods. Remember to make sure each method has only one return statement. test2024_03_12_APP1SLHL_pairs("<", ">", 7) → "<<<<<<<>>>>>>>" test2024_03_12_APP1SLHL_pairs("<", ">", 0) → "" test2024_03_12_APP1SLHL_pairs("1", "5", 2) → "1155" ...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: 330
Copyright Nick Parlante 2017 - privacy