Find bugs in a C++ program. How will you terminate a JVM without returning from the method. An array has duplicate numbers except one, find the number that is not duplicate.
Utilisateur anonyme
Easy question. Code won't compile missing semicolon System.exit(0) Throw an exception Kill JVM from task manager Naive solution: run through the list and put it in a hashmap and a count. Iterate over all the elements to see whose count is less than 2. That's yours answer Better solution: xor all the numbers in the list. The result is the one that didn't have a duplicate.