leetcode icon indicating copy to clipboard operation
leetcode copied to clipboard

Skip usage of the 'visit' set. All you need is just add an extra condition

Open RomanGirin opened this issue 2 years ago • 2 comments

You can skip usage of the 'visit' set. All you need is just add a condition 'if rooms[r][c] >= dist:' in line 34. It reduces memory usage as well as makes the code shorter.

RomanGirin avatar May 05 '23 17:05 RomanGirin

Can you provide a submission URL with this change, please

a93a avatar May 06 '23 14:05 a93a

It's locked on leetcode problem, so I can't, sorry

RomanGirin avatar May 07 '23 07:05 RomanGirin