2017-10-04

More CodingBat problems.
  1. Without10 (source). Take a list of numbers and remove all of the tens. The remaining numbers shift toward the start of the list and zeros fill in at the end.

  2. NotAlone (source). We will say that an element in an array is “alone” if there are values before and after it, and those values are different from it. Return a version of the list where every instance of the given value which is alone is replaced by whichever value to its left or right is larger.

  3. TwoTwo (source). True if every two is that appears in the list is next to another two.

  4. pre4 (source). Given a non-empty array of ints, return a new array containing the elements from the original array that come before the first four in the original array.

Last modified August 18, 2023: 2022-2023 End State (7352e87)