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

 

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

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)

public String dec16_2019_P1SLHL_removeConsecutive(String str) { }

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: 290

Copyright Nick Parlante 2017 - privacy