style: do not suppress try (#5167)

This commit is contained in:
Piotr Idzik
2024-05-26 23:32:36 +02:00
committed by GitHub
parent 37c2a96fe2
commit ea4dc15a24
7 changed files with 0 additions and 15 deletions

View File

@ -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();
}
}
/*