Big O Calculation
// What is the Big O of the below function? (Hint, you may want to go line by line)
function funChallenge(input) {
let a = 10; // O(1)
a = 50 + 3; // O(1)
for (let i = 0; i < input.length; i++) { // O(n)
anotherFunction(); // O(n)
let stranger = true;
a++; // O(n)
}
return a; // O(1)
}
function anotherFunction(){
console.log('howdy');
}
const result = funChallenge([0, 1, 2, 3, 4, 5]);
console.log(result, 'BIG O: 3 + 4n')INFO