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.
True, popleft() is O(1), but then you'll need to use deque from collections.deque. Now, deque is basically doubly-linked list, so it will have its obvious disadvantages. Moreover (though time complexity would be same), solution would still be slower than using plain list.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Maximum Perimeter Triangle
You are viewing a single comment's thread. Return to all comments →
True, popleft() is O(1), but then you'll need to use deque from collections.deque. Now, deque is basically doubly-linked list, so it will have its obvious disadvantages. Moreover (though time complexity would be same), solution would still be slower than using plain list.