help to understand the editorial soln of digjump

link for editorial page

i am trying to understand the approach of vivek of bfs but no luck.if anyone could help?

vivek sol link

i would be glad if somebody just explian this soln or add comment in it

How does a code gives explanation?