Difficulty: Medium
Title: Fix Me
Description:
Write a function called that returns an array that contains exactly the same numbers as the passed array, but rearranged so that every 9 is immediately followed by a 5. Do not move the 9's, but every other number may move. The array contains the same number of 9's and 5's, every 9 has a number after it that is not a 9, and a 9 appears in the array before any 5.
Output:
fixMe([1, 9, 1, 5])
[1, 9, 5, 1]
Difficulty: Medium
Title: Only These Characters
Description:
Write a function that returns true if all elements in an array are one of two numbers specified by the user.
Output:
Number: 1
Number: 4
Number: 1
Number: 4
Number: 1
Number to Find: 2
Number to Find: 1
False
Difficulty: Medium
Title: Mirror Me
Description:
For this program a "mirror" in an array is a group of contiguous elements such that somewhere in the array, the same group appears in reverse order. For example, the largest mirror section in {1, 2, 3, 8, 9, 3, 2, 1} is length 3 (the {1, 2, 3} part).
Output:
mirrorMe([1, 2, 3, 8, 9, 3, 2, 1])
3