I tried cancelling the white spaces and i was still left with slightly over 300. so i just beautified the code for you guys. But seriously though, what is the “legitimate way” of actually hitting under 300 without backspacing all the white spaces
my code :
function babySharkLyrics() {
let arr = ["Baby", "Mommy", "Daddy", "Grandma", "Grandpa"]
let str = "";
let j = 0;
let n = 0;
for (let i = 0; i <= 6; i++) {
if (i == 6) {
while (n < 3) {
str += `Let's go hunt, doo doo doo doo doo doo\n`
n++
}
str += `Let's go hunt!\n`
str += `Run away,...`
break
}
let k = 0;
while (k < 3) {
str += `${arr[j]} shark, doo doo doo doo doo doo\n`
k++
}
str += `${arr[j]} shark!\n`
j++
}
return str
}
babySharkLyrics()