SImple hashmap solution

```java []
class Solution {
    public int[] recoverArray(int[] nums) {
       
        Arrays.sort(nums);
         int s=nums[0];
        for(int i=1;i<nums.length;i++){
           int  k=(nums[i]-s);
          if(k==0)continue;
            if(k%2!=0)continue;
                k=k/2;
                //if(k==0)continue;
             if(s+k!=nums[i]-k)continue;  
                HashMap<Integer,Integer>hm=new HashMap<>();
              ArrayList<Integer>al=new ArrayList<>();
              al.add(s+k);
           //   al.add(nums[i]-k);
            for(int j=1;j<nums.length;j++){
               if(j==i)continue;
                hm.put(nums[j],hm.getOrDefault(nums[j],0)+1);
            }
            for(int j=1;j<nums.length;j++){
                if(j==i)continue;
                if(!hm.containsKey(nums[j]))continue;
                if(hm.containsKey(nums[j]+2*k)){
                         hm.put(nums[j]+2*k,hm.getOrDefault(nums[j]+2*k,0)-1);
                        if(hm.get(nums[j]+2*k)<=0)hm.remove(nums[j]+2*k);
                        hm.put(nums[j],hm.getOrDefault(nums[j],0)-1);
                        if(hm.get(nums[j])<=0)hm.remove(nums[j]);
                        al.add(nums[j]+k);
                       // al.add(nums[j]+2*k);
                }
                else{

                }
            }
         //  System.out.println(hm+" "+al+" "+i+" "+k+" "+nums[i]);
            if(al.size()==nums.length/2){
                int[]ans=new int[al.size()];
                for(int ll=0;ll<al.size();ll++){
                    ans[ll]=al.get(ll);
                }
                return ans;
            }
        }
        return new int[]{};
    }// 2 4 6 8 10 12   nums[0]<nums[1]-k||nums[0]>=nums[1]+k nums[l]+k;
}
```
['Java']