Problem D2: Line of Delivery (Part 2) Solution
Hello All, I would Like to discuss the problem D2 in recent Meta Hackercup Practice Round of 2024. This problem's solution says we can use treap datastructure to support the operations mentioned in the problem.
Operation 1) Insert a stone at $$$E_i^{th}$$$ empty position.
Operation 2) Move all stones to the left of inserted stone by 1 unit in negative direction.
Yes treaps can be used to solve this problem, But I have come up with a simple vectors approach to solve this.