Tag: simulation algorithm
This problem is from Google Kickstart (Round F 2020 – Kick Start 2020). There are N people numbered from 1 to N, standing in a queue to withdraw money …
The File system keeps a log each time some user performs a change folder operation. The operations are described below: “../” : Move to the parent folder of the …
Given numBottles full water bottles, you can exchange numExchange empty water bottles for one full water bottle. The operation of drinking a full water bottle turns it into an …
Given a non-negative integer num, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by 2, otherwise, …
At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by …