You are viewing a single comment's thread. Return to all comments →
The OP is O(n)
its o(n^2), coz in worst case senario, all the choclate blocks would add up to d.
How do we find out the time complexity. someone pls help me out