arr to store the decoded elements.first element to arr.encoded array.
a. Calculate the next element by XORing the last element in arr with the current element in encoded.
b. Append the calculated element to arr.arr list containing the decoded elements.