2017-10-04
More CodingBat problems.
-
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.
-
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.
-
TwoTwo (source). True if every two is that appears in the list is next to another two.
-
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.