# Exercises

0 / 70

Return the centered average of an array of `int`s, which we'll say is the mean average of the values, except ignoring the largest and...

0 / 70

Given a number `n`, create and return a new `int` array of length `n`, containing the numbers 0, 1, 2, ... n-1. The given `n` may be 0, in which...

0 / 70

Given a number `n`, create and return a new string array of length `n`, containing the strings "0", "1" "2" .. through n-1. `N` may be 0, in...

0 / 70

Given an array of `int`s, return `true` if the array contains a 2 next to a 2 somewhere.

0 / 70

Given an array of `int`s, return `true` if the array does not contain any 1s or 3s. Otherwise, return `false`.

0 / 70

Given an array of `int`s, return `true` if the sum of all the 2's in the array is exactly 8.

0 / 70

Given an array of `int`s, return `true` if the number of 1s is greater than the number of 4s. Otherwise, return `false`.

0 / 70

Given an array of ints, return `true` if every element is either a 1 or a 4. Otherwise, return `false`.

0 / 70

Consider the series of numbers beginning at `start` and running up to but not including `end`, so for example start=1 and end=5 gives the...

0 / 70

Given an array of `int`s, if it contains no 1's return `true`. If it contains no 4's, return `true`. If it contains both, return `false`.

0 / 70

Given an array of `int`s, return `true` if the array contains a 2 next to a 2 or a 4 next to a 4, but not both. Otherwise, return `false`.

0 / 70

Given an array of `int`s, return `true` if the array contains two 7s next to each other, or there are two 7s separated by one element, such...

0 / 70

Given an array of `int`s, return `true` if there is a 1 in the array with a 2 somewhere later in the array.

0 / 70

Given an array of `int`s, return `true` if the value 3 appears in the array exactly 3 times, and no 3s are next to each other.

0 / 70

Given an array of `int`s, return `true` if every 2 that appears in the array is next to another 2. Otherwise, return `false`.

0 / 90

Given a non-empty array, return `true` if there is a place to split the array so that the sum of the numbers on one side is equal to the...

0 / 90

Consider the leftmost and righmost appearances of some value in an array. We'll say that the span is the number of elements between the...

0 / 90

Return an array that contains exactly the same numbers as the given array but re-arranged so that every 3 is immediately followed by a 4....

0 / 90

We'll say that a "mirror" section in an array is a group of contiguous elements such that somewhere in the array, the same group appears...

0 / 50

For this problem, we'll round an `int` value up to the next multiple of 10 if its rightmost digit is 5 or more, so 15 rounds up to 20....

0 / 50

We want make a package of `goal` kilos of chocolate. We have small bars (1 kilo each) and big bars (5 kilos each). Return the number of...

0 / 50

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 / 50

Given a string of even length, return the first half. So the string "WooHoo" yields "Woo".

0 / 50

Write a function in Java that implements the following logic: Return a version of the given array where each zero value in the array is...

0 / 50

Given a non-empty array of `int`s, return a new array containing the elements from the original array that come before the first 4 in the...