Get Time
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat  | Threaded  | Tree
Previous Thread  |  Next Thread
A somewhat better solution | Reply
I think that your solutions are good, but running a BFS involves a sizable time complexity. I solved the Grafix Map problem in a O(n^2) and I am working on bringing it down to an O(n). I did this by simply feeding the input into a UnionFind data structure that I wrote. I enhanced this structure with the ability to return a list of all connected points as a list of lists.
Please see this on my github website at: and comment on it if you are interested.
Regards, ...
Subject Author Date
A somewhat better solution StevenLinzer Oct 2, 2017 at 10:20 AM EDT