We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
According to your algorithm if we supply the following output
4
2 1
1 4
2 2
1 1
it gives the output as 2 wheras technically there is no solution to this scenario as you are only considering from the point until the end of the list whereas it should be considered as a queue which wraps around. Please correct me if I am wrong.
Truck Tour
You are viewing a single comment's thread. Return to all comments →
According to your algorithm if we supply the following output 4 2 1 1 4 2 2 1 1
it gives the output as 2 wheras technically there is no solution to this scenario as you are only considering from the point until the end of the list whereas it should be considered as a queue which wraps around. Please correct me if I am wrong.