Given an array containing three ints, return the sum of all the elements. It is safe to assume that the array always has at least 3...
array
Score: 0 / 10.0
Exercises
Write a function in Java that takes an int
array as its parameter and returns the number of even int
s it contains. Note: the %
"mod"...
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...
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...
Given an array of ints, return true
if every element is either a 1 or a 4. Otherwise, return false
.
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...
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...
Given a string of any length, return a new string where the last 2 chars, if present, are swapped, so "coding" yields "codign".
Given an array of integers and an integer target
, return a count of the number of times the target
value occurs in the array.
Given an array of int
values, return true if the array contains either 3 even or 3 odd values all next to each other.