I feel like i;m not good enough . I basically inspired myself from other sources for almost all alogrithms problems till now. Maybe i just spend too less time on it. Like,if i can’t make it in 5 minutes i start googling it or checking the FCC solution code. Here is the return largest number alogrithm,i couldn/t do it so i basically had to write their solution. Can someone explain me the code,I really don’t understand it.
function largestOfFour(arr) {
// You can do this!
var arrays= [];
for (i = 0 ; i < arr.length;i++){
var biggestNum = arr[i][0];
for (var x = 1 ; x < arr[i].length; x++) {
if (arr[i][x] >biggestNum) {
biggestNum = arr[i][x];
}
}
arrays[i] = biggestNum;
}
return arrays;
}