3 ms·
So how would the expected answer look like? 1. Create an array of visited squares 2. Return false if square has been visited before, add current square to vis
by Kiro 12y ago
So how would the expected answer look like?
1. Create an array of visited squares
2. Return false if square has been visited before, add current square to visited
3. Return true
Would this be correct?
- thewarrior 12y agoSort of. Store the squares in a hash map with the value used to indicate whether you've already seen it.