Back to course home
0% completed
Take Gifts From the Richest Pile(easy)
Problem Statement
You're presented with several piles of gifts, with each pile containing a certain number of gifts. Every second, you'll engage in the following activity:
- Pick the pile that contains the highest number of gifts. If multiple piles share this distinction, you can select any of them.
- Compute the square root of the number of gifts in the selected pile, and then leave behind that many gifts (rounded down). Take all the other gifts from this pile.
- You'll do this for "k" seconds. The objective is to find out how many gifts would still remain after these "k" seconds.
.....
.....
.....
Like the course? Get enrolled and start learning!
Table of Contents
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible