CodeWorkout X71-X120

Score: 0 / 24.0


Exercises

0 / 1.0

Given a string, if the same 2-character substring appears at both its beginning and end, return the contents of the string without the...

0 / 1.0

Given a string str and an int n, return a string made of the first n characters of the string, followed by the first n - 1 characters of...

0 / 1.0

Return an array that contains the exact same numbers as the given array, but rearranged so that all the even numbers come before all the...

0 / 1.0

Given n >= 0, create an array with the pattern {1, 1, 2, 1, 2, 3, ... 1, 2, 3 .. n} (spaces added to show the grouping). Note that...

0 / 1.0

Given a string of any length, return a new string where the last 2 chars, if present, are swapped, so "coding" yields "codign".

0 / 1.0

Given a string, return true if "bad" appears starting at index 0 or 1 in the string, such as with "badxxx" or "xbadxx" but not "xxbadxx"....

0 / 1.0

Return a version of the given string, where for every star (*) in the string the star and the character immediately to its left and the...

0 / 1.0

Return true if somewhere in the array, there are three increasing adjacent numbers like .... 4, 5, 6, ... or 23, 24, 25.

0 / 1.0

Given start and end integers, return a new array containing the sequence of integers from start up to but not including end, so start = 5...

0 / 1.0

Return an array that is "left shifted" by one--so for an input of {6, 2, 5, 3}, the method returns {2, 5, 3, 6}. You may modify and...

0 / 1.0

Given a non-empty array of ints, return a new array containing the elements from the original array that come after the last 4 in the...

0 / 1.0

We'll 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...

0 / 1.0

Return an array that contains the exact same numbers as the given array, but rearranged so that all the zeros are grouped at the start of...

0 / 1.0

Given two arrays of ints sorted in increasing order, called outer and inner, return true if all of the numbers in inner also appear in ...

0 / 1.0

Given n >= 0, create an array of length n * n with the following pattern, shown here for n = 3 : {0, 0, 1, 0, 2, 1, 3, 2, 1} (spaces...