Verify path in directed graph. Problem of the day.