-
-
Save IrhaAli/71f6133b7297a75be83fe907d47a6092 to your computer and use it in GitHub Desktop.
Returns spot to part at, if available.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const whereCanIPark = function (spots, vehicle) { | |
//look through each row | |
for (let i = 0; i < spots.length; i++){ | |
//look through each column | |
for (let j = 0; j < spots[i].length; j++){ | |
if (spots[i][j] === vehicle[0].toUpperCase()){ | |
return [j,i]; | |
} | |
} | |
} | |
return false; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment