Tell us what’s happening:
Test case 3 is incorrect. The character found at [1,1] is “O”, which is to return “Recovered”. Can someone please fix this?
Your code so far
function dive(map, coordinates) {
const char = map[coordinates[0]][coordinates[1]];
console.log(char)
return char === "-" ? "Empty" : char === "X" ? "Found" : "Recovered";
}
console.log(dive([[ "-", "X"], [ "-", "O"], [ "-", "O"]], [1, 1]))
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Challenge Information:
Daily Coding Challenge - Hidden Treasure
https://www.freecodecamp.org/learn/daily-coding-challenge/2025-10-24