about | help | code help+videos | done | prefs |
Write a method that accepts a string input parameter called 'str'. Return a version of 'str' that does not include any letters that are immediately followed by the next letter alphabetically. For example, if the input string is "abdefghijklmnop" you would return "bp". The letter 'a' is immediately followed by a 'b' which is why it is not included. Then there are a whole bunch of letters immediately followed by the next letter, so those are not included. You may assume 'str' will only contain lower-case letters and no symbols. Look at the test data for more examples. dec16_2019_P1SLHL_removeConsecutive("abcdefghijklmnopqrstuvwxyefghijklmnoabcda") → "yoda" dec16_2019_P1SLHL_removeConsecutive("lkajadfwe") → "lkajadfwe" dec16_2019_P1SLHL_removeConsecutive("lkhwaeoidsggas") → "lkhwaeoidsggas" ...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