modemean
that accepts an array of numbers, and returns a boolean indicating if the mode and mean of the array are equal.
nthFibonacci
that returns the nth Fibonacci number. A Fibonnaci sequence is a list of numbers that begin with 0 and 1, and each subsequent number is the sum of the previous two.
gcd
that accepts two integers, and returns the greatest common divisor.
rotategrid
that is given an NxN grid of elements represented by a 2D array, and outputs a grid equivalent to the same grid rotated 90 degrees clockwise.
transpose
that accepts a two dimensional array and returns a transposed version of that array
anagrams
that accepts a string, and returns an array of all possible anagrams of the string.
permPalin
that accepts a string, and returns a boolean indicating if ANY of the permutations of that string is a palindrome.
knightjumps
that will accept two numbers, indicating the location of a knight on a standard 8x8 chess board with no other pieces on the board. The two arguments, x
and y
, range from 1 to 8. knightjumps
should return the number of spaces that the knight can move to from those given coordinates. For example: if the invocation is knightjumps(4, 5)
, then knightjumps
should output 8 because the knight can move to 8 different spaces from position x = 4 and y = 5.
countTwos
that takes a number as an argument, num
. The function will return the number of 2s encountered on EVERY number when counting from 1 to num
(inclusive). 2222 counts as having 4 2s.