about | help | code help+videos | done | prefs |
Write a method called strMasher that accepts a string and an integer. It then returns a new string made from the old string in the way explained in this example: Suppose our string is "ABCDEFGHI" and the number is 3. We will start with the first letter, then go down three letters, then go down another three letters like such: "ADG" but at the same time we will remove those letters from the original string leaving: "BCEFHI". We now repeat this process giving "BF" and leaving "CEHI" which will then repeat the process giving "CI" and leaving "EH". This continues until all the characters in the string are used up. Return a string that is made up of all the removed letters in the order in which they were removed. Look at the sample data for clarification. strMasher("Winston", 4) → "Wtinnso" strMasher("Churchill", 3) → "Crihhulcl" strMasher("Churchill", 2) → "Cucilhhrl" ...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