This issue suggests modifying the solution to the problem 1514. Path with Maximum Probability without using a queue. Apparently, from other submissions, it seems that repeatedly updating the maximum probabilities array while it can still be updated is more optimized compared to using a queue that prioritizes nodes where the maximum probabilities are updated.
This issue suggests modifying the solution to the problem 1514. Path with Maximum Probability without using a queue. Apparently, from other submissions, it seems that repeatedly updating the maximum probabilities array while it can still be updated is more optimized compared to using a queue that prioritizes nodes where the maximum probabilities are updated.