Skip to content
RED SAGSkills
hard20 pts · first answer countsgraphsgrid-graphsperformance

Visited set for a 5000 × 5000 grid

A BFS on a 5000 × 5000 grid stores visited cells in a JavaScript Set of strings like "r,c" and runs out of memory. What is the best fix?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions