Please solve the programming task below using a self-contained code snippet in a markdown code block.

You are given an integer array gifts denoting the number of gifts in various piles. Every second, you do the following:

Choose the pile with the maximum number of gifts.
If there is more than one pile with the maximum number of gifts, choose any.
Leave behind the floor of the square root of the number of gifts in the pile. Take the rest of the gifts.

Return the number of gifts remaining after k seconds.
 
Please complete the following python code precisely:
```python
class Solution:
    def pickGifts(self, gifts: List[int], k: int) -> int:
```