Time limited!!! But run normally on my laptop


  • 0
    D

    Hi, guys. I use DFS to find all shortest transformation. The code runs well with the test given by leetcode OJ less than 1s. I do not know why time limited error happens in OJ.


  • 0
    M

    Could you give us the code? And do you mean BFS? DFS isn't really that fast at solving the shortest path problem.


  • 0
    S

    LeetCode OJ runs all test case in once. For one specific test case, you may pass. But run all of them together, the total time cost might beyond the limit.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.