Original Array profix xor | Explanation
Hi,\n\nUnderstanding my solution is as follows:\n\npref[i] = pref[i-1] ^ res[i];\n\nso we have to find the value of \'res[i]\', so we move the xor operation to 
Hi,\n\nUnderstanding my solution is as follows:\n\n**pref[i] = pref[i-1] ^ res[i];**\n\nso we have to find the value of \'res[i]\', so we move the xor operation to the other side:\n\n**res[i] = pref[i] ^ pref[i-1];**\n\nWhen i=0 the xor res value will be same as given array.\n\nHappy learning, kindly upvote if helps:\n\n```\n    public int[] findArray(int[] pref) {\n        int res[] = new int[pref.length];\n        res[0]=pref[0];\n        for(int i=1; i<pref.length; i++){\n        \tres[i]=pref[i]^pref[i-1];\n        }\n        return res;\n    }
['Java']