Generation

generate functionThu, 02 Feb 2023

there's an array of integers. All of them have a pair but one not. Find that one

int findSingle(int arr[], int n) { int res = arr[0]; for (int i=1; i<n; i++) res = res ^ arr[i]; return res; }

Want to kickstart your project?Use the new AI Studio to create your code