What do you want to save?
Add Code snippet
New code examples
-
Python 2022-01-30 18:20:48
first_last6
# first_last6 - https://codingbat.com/prob/p181624 # Given an array of ints, return True if 6 appears as either the first or last element in the array. The array will be length 1 or more. # first_last6([1, 2, 6]) = True # first_last6([6, 1, 2, 3]) = True ... Add solution -
Javascript 2021-10-06 11:13:04
javascript consecutive numbers in array
/** * Given an array of number, group algebraic sequences with d=1 * [1,2,3,4,5,6] => true * [1,2,4,5,6] => false */ var arr = [1,2,4,5,6]; const differenceAry = arr.slice(1).map(function(n, i) { return n - arr[i]; }) const isDifference= dif... Add solution