Module arrays

Source
Expand description

Modules categorized by Codewars labels - 8kyu *** Arrays ***

Functionsยง

first_non_consecutive
Your task is to find the first element of an array that is not consecutive. If the whole array is consecutive then return null. The array will always have at least 2 elements and all elements will be numbers. The numbers will also all be unique and in ascending order. The numbers could be positive or negative and the first non-consecutive could be either too!
merge_arrays
You are given two sorted arrays that contain only integers. These arrays may be sorted in either ascending or descending order. Your task is to merge them into a single array, ensuring that: The resulting array is sorted in ascending order. Any duplicate values are removed, so each integer appears only once. If both input arrays are empty, return an empty array. No input validation is needed, as both arrays are guaranteed to contain zero or more integers.
square_sum
Complete the square sum function so that it squares each number passed into it and then sums the results together.