Jan Return 2

This review assumes that you have done CodingBat Logic-1 and String-2.

  1. (dollarOut) Return a version of the given string where every appearance of $ in the original string is removed, along with two characters to the left and one character to the right of it. If there are not that many characters, remove what is available.

     public String dollarOut(String str) {...}
    
     dollarOut("spend$now") => "speow"
     dollarOut("some$dollar$xy") => "soolly"
     dollarOut("A$lan") => "an"
     dollarOut("lo$") => ""
    
  2. (decString) Given three strings x y z, return true if each one is shorter than the previous one. Unless sameSize is true, in which case also return true if the previous string is the same size.

     public boolean decString(String x, String y, String z, boolean sameSize) {...}
    
     decString("aaaaa","bbb","c", false) => true
     decString("apple","cart","horse",true) => false
     decString("banana","mango","orang",true) => true
     decString("plum","watermelon","yam",true) => false
    
Last modified August 18, 2023: 2022-2023 End State (7352e87)