Tell us what’s happening:
I am doing the daily challenge called hidden Treasure. according to the instructions when the coordinate points to “O” the return value should be “Recovered”. However according to the 3. test dive([[ “-”, “X”], [ “-”, “O”], [ “-”, “O”]], [1, 1]) should return “Found”. I don’t understand why it is not “Recovered”.
Your code so far
def dive(map, coordinates):
if map[coordinates[0]][coordinates[1]] == "-":
return "Empty"
elif map[coordinates[0]][coordinates[1]] == "X":
return "Found"
elif map[coordinates[0]][coordinates[1]] == "O":
return "Recovered"
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0.1 Safari/605.1.15
Challenge Information:
Daily Coding Challenge - Hidden Treasure
https://www.freecodecamp.org/learn/daily-coding-challenge/2025-10-24