I’m trying to solve this question (link DIGJUMP - Editorial ).
I have used modified bfs and I have already gone through all the test cases provided in the comment section of the editorial by other users and I’m getting correct and for all the testcases.
Consider the test case where S
is 100000 0
s.
1 Like
My code’s output: 2 (1 -> 0 (first occurrence) -> 0 (last occurrence ) )
Am I correct or is something missing in my logic?
On my machine, your code gives the output:
1
but it takes 18 seconds to do it.
1 Like