help to understand the editorial soln of digjump

link for editorial page https://discuss.codechef.com/questions/44800/digjump-editorial

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

vivek sol link https://www.codechef.com/viewplaintext/4109825

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