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.
- Prepare
- Python
- Collections
- Piling Up!
- Discussions
Piling Up!
Piling Up!
Sort by
recency
|
979 Discussions
|
Please Login in order to post a comment
Enter your code here. Read input from STDIN. Print output to STDOUT
from collections import deque
num_of_tests = int(input())
for ntest in range(num_of_tests): # read number of blocks num_of_blocks = int(input())
here is my solution and works
Saw lots of deque, but I think a direct index approach is faster no? Avoids updating the list.