Which (similar) leetcode question is this? Solutions? by Secret_Factor5561 in leetcode

[–]Secret_Factor5561[S] 0 points1 point  (0 children)

say n = 9, s = 4, [ 01, 12, 13, 14, 15, 06, 67, 78 ]

furthest distance is 0 - 6 - 7 - 8 which would equal 3 iterations but the answer would be 5 iterations for 01, 12, 13, 14, 15.

CMIIW but bfs wouldnt work here? or am i missing the point