Use a boolean array instead of a HasSet to lookup the visited nodes


#1

The time penalty for a HashSet is significant in this case!


#2

Jan bacha li dost! samjh hi nhi aa rha tha visited se bhi error aayega.