Minimum Jump Game DP Using BFS

Правка en1, от 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..

Теги #interview, #dp, bfs, complexity optimization

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский aman_naughty 2019-07-07 21:24:45 1228 Initial revision (published)