[Python] Python straight-forward solution using two hashmaps
The key of this problem is how to use dry days wisely.  So every time we meet a dry day, we save it for future use. \n\nTwo hashmaps: first hashmap for tracking
The key of this problem is **how to use dry days wisely.**  So every time we meet a dry day, we save it for future use. \n\nTwo hashmaps: **first hashmap for tracking the lake state, second for keeping track of the last rainy day of this lake.**\n\n1. if the lake is empty and we encounter a rainy day, simply update the state of this lake.\n2. if the lake is full, and it rains again, check if there is a dry day we can use. **if there is an available dry day after the last rain day, use it for drying this lake;** if we can\'t find a qualified dry day, we can directly return `[]`.\n\nNot optimal, but this idea is relatively easy to understand.\n\n```\nclass Solution:\n    def avoidFlood(self, rains: List[int]) -> List[int]:\n        lakes = collections.defaultdict(bool)\n        lastrain = collections.defaultdict(int)\n        res = []\n        dry = []\n        for k,v in enumerate(rains):\n            if v > 0:\n                if not lakes[v]:\n                    lakes[v] = True\n                    res.append(-1)\n                    lastrain[v] = k\n                else:\n                    # lakes[v] == True\n                    if dry == []:\n                        return []\n                    else:\n                        # check if there is a dry day we can use\n                        i = 0\n                        found = False\n                        while i < len(dry) and not found:\n                            if dry[i] > lastrain[v]:\n                                found = True\n                                dry_day = dry[i]\n                            else:\n                                i += 1\n                        if found:\n                            res[dry_day] = v\n                            lastrain[v] = k\n                            dry.pop(i)\n                            res.append(-1)\n                        else:\n                            return []\n            elif v == 0:\n                res.append(1)\n                dry.append(k)\n        return res\n```
[]