Such an unordinary question
cpp\nint n = rains.size();\n// set default value to 1 for no particular reason.\nvector<int> ans(n, 1);\n// those days we can dry a lake.\nset<int> dry_day;\n//
```cpp\nint n = rains.size();\n// set default value to 1 for no particular reason.\nvector<int> ans(n, 1);\n// those days we can dry a lake.\nset<int> dry_day;\n// the day when the particular lake is full.\nmap<int, int> full;\n\n// for each day\nfor (int i = 0; i < n; ++i)\n{\n\t// if it is rainning\n\tif (rains[i])\n\t{\n\t\t// if the lake is full\n\t\tif (full[rains[i]])\n\t\t{\n\t\t\t// we try to find a possible sunny day in the past since the day this lake was filled.\n\t\t\tauto it = dry_day.lower_bound(full[rains[i]]);\n\t\t\t\n\t\t\t// if we can not find a possible day, return fail.\n\t\t\tif (it == dry_day.end())\n\t\t\t\treturn {};\n\t\t\t\n\t\t\t// set the day to dry this lake\n\t\t\tans[*it] = rains[i];\n\t\t\t// the chosen day can no longer be available.\n\t\t\tdry_day.erase(it);\n\t\t}\n\t\t\n\t\t// record the day when this lake is filled.\n\t\tfull[rains[i]] = i + 1;\n\t\t// the ans of raining day is always -1\n\t\tans[i] = -1;\n\t}\n\telse // if it\'s sunny\n\t{\n\t\tdry_day.insert(i);\n\t}\n}\n\nreturn ans;\n```\n
['C', 'Ordered Set']