Given an integer N, list all the divisors of N (excluding N) in sorted order. Find the number formed by performing the XOR operation on each divisor in the list.
Input: N = 10
1 2 5
All the proper divisors are 1, 2 and 5.
1 XOR 2 XOR 5 = 6
Input: N = 8
1 2 4
All the proper divisors are 1, 2 and 4.
1 XOR 2 XOR 4 = 7
You don't need to read or print anything. Your task is to complete the function xor_play() which takes N as input parameter and returns a list of integers containing all the proper divisors in sorted order. The last element in the list must contain the XOR result.
Expected Time Complexity: O(sqrt(N)) Expected Space Complexity: O(K) where K is the number of divisors of N.