mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-25 05:22:39 +08:00
style: do not suppress try
(#5167)
This commit is contained in:
@ -30,12 +30,6 @@ public final class NonRepeatingElement {
|
||||
arr[i] = sc.nextInt();
|
||||
}
|
||||
|
||||
try {
|
||||
sc.close();
|
||||
} catch (Exception e) {
|
||||
System.out.println("Unable to close scanner" + e);
|
||||
}
|
||||
|
||||
// Find XOR of the 2 non repeating elements
|
||||
for (i = 0; i < n; i++) {
|
||||
res ^= arr[i];
|
||||
@ -55,7 +49,6 @@ public final class NonRepeatingElement {
|
||||
}
|
||||
|
||||
System.out.println("The two non repeating elements are " + num1 + " and " + num2);
|
||||
sc.close();
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
Reference in New Issue
Block a user