Ad

Write a script which can find indexes & sum of biggest possible sequence subarray items.

Example:

findBiggestSubArray([1, 2, -3, 2])
should return array like [a, b, c]
Where:
a: maximal sum of sequence
b: start index if sequence
c: last index of sequence

More examples:
findBiggestSubArray([1, 1, 1, 1, 1, 1, -5]) ==> return [6, 0, 5]
findBiggestSubArray([-9,1,3,1,1,-6,0,-9]) ==> [6, 1, 4]
findBiggestSubArray([-9,4,-1,5]) ==> [8, 1, 3]
findBiggestSubArray([-9, 4, 1, 1, -9, 5]) ==> [6, 1, 3]
findBiggestSubArray([-9]) ==> [-9, 0, 0]
findBiggestSubArray([-9,8,-2.5,2,1]) ==> [8.5, 1, 4]

function findBiggestSubArray(arr) {
  return []
}

Create functions thas can sort an array using insertion sort algorithm. Function should return a COPY of sorted array, so the original array wouldn't be mutated

Note: you shouldn't use loops (for/while). Try to complete task in a functional way.

function insertionSort(arr) {
  // return sorted array
}
// TODO: Create method objectFreeze which works the same as native Object.freeze.
// !IMPORTANT: You haven't use Object.freeze during your task

function objectFreeze(obj) {
  return Object.freeze(obj);
}