78 th testcase failing can anyone tell why
testcase -[1,0,2,0,3,0,2,0,0,0,1,2,3]\nexpected ouput-[-1,1,-1,2,-1,3,-1,2,1,1,-1,-1,-1]\noutput -[-1,1,-1,2,-1,3,-1,1,1,1,-1,-1,-1]\n\nclass Solution {\n    pu
testcase -[1,0,2,0,3,0,2,0,0,0,1,2,3]\nexpected ouput-[-1,1,-1,2,-1,3,-1,2,1,1,-1,-1,-1]\noutput -[-1,1,-1,2,-1,3,-1,1,1,1,-1,-1,-1]\n```\nclass Solution {\n    public int[] avoidFlood(int[] rains) {\n            HashMap<Integer,Integer> map=new HashMap<>();\n            TreeMap<Integer,Integer> tree=new TreeMap<>();\n            int[] ans=new int[rains.length];\n        for(int i=0;i<rains.length;i++){\n            if(rains[i]==0){\n                ans[i]=1;\n              tree.put(i,0);\n            }else{\n                if(map.containsKey(rains[i])){\n                  Integer x= tree.ceilingKey(map.get(rains[i]));\n                    if(x==null)return new int[]{};\n                    else{\n                        map.remove(rains[i]);\n                       ans[x]=rains[i];\n                        tree.remove(x);\n                    }\n                }\n                else{\n                    map.put(rains[i],i);\n                }\n            }\n        }\n        \n        \n        for(int i=0;i<ans.length;i++){\n            if(rains[i]>0)ans[i]=-1;\n        }\n      \n         return  ans;\n    }\n}\n```\n
[]