Write three tests, a signature, and the function for each.
nearTen
Logic-1. Given a
positive Integer n
, return True if n
is within two of a
multiple of ten.matchUp
Array-2. Given two lists of
the same number of Int
, consider
the each pair of elements with the same index (same position in the
list when lined up). Return the count of the number of times that
the two elements differ by two or less, but are not equal.
Periods are short today.
Extra credit. Write a signature using class constraints:
f x a y = if x == a then sqrt(y) else y