{"id":"3e8a90bf-6212-46e6-9082-ec3f23a1cf73","name":"All Repeating Except Two","description":"1. You are given an array of numbers.\r\n2. You have to find 2 non-repeating numbers in an array.\r\n3. All repeating numbers are repeating even number of times.","inputFormat":"A number n\r\na1\r\na2..\r\nn numbers","outputFormat":"2 Non-repeating number","constraints":"1 &lt;= n &lt;= 10^9\r\n1 &lt;= a1,a2.. &lt;= 10^9 ","sampleCode":{"cpp":{"code":"#include<bits/stdc++.h>\nusing namespace std;\n\nvoid solution(vector<int>&arr){\n //write your code here \n \n}\nint main(){\n int n;\n cin>>n;\n \n vector<int>arr(n);\n for(int i=0;i<n;i++){\n cin>>arr[i];\n }\n \n solution(arr);\n}"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args){\r\n Scanner scn = new Scanner(System.in);\r\n int n = scn.nextInt();\r\n int[] arr = new int[n];\r\n for(int i = 0 ; i < n; i++){\r\n arr[i] = scn.nextInt();\r\n }\r\n solution(arr);\r\n }\r\n\r\n public static void solution(int[] arr){\r\n //write your code here\r\n \r\n }\r\n\r\n}"},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"6\r\n23 27 23 17 17 37","sampleOutput":"27\r\n37","questionVideo":"https://www.youtube.com/embed/pnx5JA9LNM4?end=41","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"f3e3dbef-d2b7-4f6d-b357-2ef3738e6c91","name":"Bit Manipulation For Intermediate","slug":"bit-manipulation-for-intermediate-9995","type":0},{"id":"68e11e77-0389-4731-8ec0-ba35d212fdea","name":"All Repeating Except Two","slug":"all-repeating-except-two","type":1}],"next":{"id":"fab1fac5-b52c-490d-8656-d9b90853feb3","name":"All Repeating Except two MCQ","type":0,"slug":"all-repeating-except-two-mcq"},"prev":{"id":"41db2769-464a-47e7-9a1e-f203e360e9a7","name":"All Repeating Except One","type":3,"slug":"all-repeating-except-one"}}}

All Repeating Except Two

1. You are given an array of numbers. 2. You have to find 2 non-repeating numbers in an array. 3. All repeating numbers are repeating even number of times.

{"id":"3e8a90bf-6212-46e6-9082-ec3f23a1cf73","name":"All Repeating Except Two","description":"1. You are given an array of numbers.\r\n2. You have to find 2 non-repeating numbers in an array.\r\n3. All repeating numbers are repeating even number of times.","inputFormat":"A number n\r\na1\r\na2..\r\nn numbers","outputFormat":"2 Non-repeating number","constraints":"1 &lt;= n &lt;= 10^9\r\n1 &lt;= a1,a2.. &lt;= 10^9 ","sampleCode":{"cpp":{"code":"#include<bits/stdc++.h>\nusing namespace std;\n\nvoid solution(vector<int>&arr){\n //write your code here \n \n}\nint main(){\n int n;\n cin>>n;\n \n vector<int>arr(n);\n for(int i=0;i<n;i++){\n cin>>arr[i];\n }\n \n solution(arr);\n}"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args){\r\n Scanner scn = new Scanner(System.in);\r\n int n = scn.nextInt();\r\n int[] arr = new int[n];\r\n for(int i = 0 ; i < n; i++){\r\n arr[i] = scn.nextInt();\r\n }\r\n solution(arr);\r\n }\r\n\r\n public static void solution(int[] arr){\r\n //write your code here\r\n \r\n }\r\n\r\n}"},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"6\r\n23 27 23 17 17 37","sampleOutput":"27\r\n37","questionVideo":"https://www.youtube.com/embed/pnx5JA9LNM4?end=41","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"f3e3dbef-d2b7-4f6d-b357-2ef3738e6c91","name":"Bit Manipulation For Intermediate","slug":"bit-manipulation-for-intermediate-9995","type":0},{"id":"68e11e77-0389-4731-8ec0-ba35d212fdea","name":"All Repeating Except Two","slug":"all-repeating-except-two","type":1}],"next":{"id":"fab1fac5-b52c-490d-8656-d9b90853feb3","name":"All Repeating Except two MCQ","type":0,"slug":"all-repeating-except-two-mcq"},"prev":{"id":"41db2769-464a-47e7-9a1e-f203e360e9a7","name":"All Repeating Except One","type":3,"slug":"all-repeating-except-one"}}}
plane

Editor


Loading...

All Repeating Except Two

easy

1. You are given an array of numbers. 2. You have to find 2 non-repeating numbers in an array. 3. All repeating numbers are repeating even number of times.

Constraints

1 <= n <= 10^9 1 <= a1,a2.. <= 10^9

Format

Input

A number n a1 a2.. n numbers

Output

2 Non-repeating number

Example

Sample Input

6 23 27 23 17 17 37

Sample Output

27 37

Question Video

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode