Easy Java Solution
Find The Original Array of Prefix Xor\n# Easy Java Solution\n\nApproach:\n1.) The resultant array can be found by doing the Xor of the prev ans with current pre
# Find The Original Array of Prefix Xor\n# Easy Java Solution\n\n**Approach:**\n1.) The resultant array can be found by doing the Xor of the prev ans with current pref[i].\n2.) Initially prev would be 0.\n\n```\nclass Solution {\n    public int[] findArray(int[] pref) {\n        //Creating an ans array\n        int[] ans=new int[pref.length];\n        int prev=0;\n        for(int i=0;i<pref.length;i++){\n            //Getting the prev XOR pref[i] as our current answer\n            ans[i]=prev^pref[i];\n            //Storing pref[i] as prev\n            prev=pref[i];\n        }\n        return ans;\n    }\n}\n```
['Java']