Minimum Jump Game DP Using BFS

Revision en1, by aman_naughty, 2019-07-07 21:24:45

Problem Link — problem

code —

code

Why is this giving TLE? I am only visiting each array index only once.I am considering this as a graph problem where the neighbors of a node are all the indices reachable from that index.Then BFS will clearly result in the shortest path to reach index n-1.Can someone help me please..

Tags #interview, #dp, bfs, complexity optimization

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English aman_naughty 2019-07-07 21:24:45 1228 Initial revision (published)