This is where the solution is wrong. `getOutgoingStates` gives you all outgoing states from a given state *including the ones to different URL`s*.

Let's say the you are at a state with 2 outgoing edges and the max is 2. However, both edges point to states with different URL`s. In your solution the crawler will stop, while it should actually continue.