We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b12a25d commit 1d8b3aeCopy full SHA for 1d8b3ae
src/main/java/com/hackerrank/algorithms/recursion/RecursiveDigitSum.java
@@ -24,7 +24,11 @@ public class RecursiveDigitSum {
24
private static int superDigit(String n, int k) {
25
if(n == null) throw new Exception("by input exception [" + n + "]");
26
if (n.length() == 1 && k == 0) {
27
- return Integer.parseInt(n);
+ try {
28
+ return Integer.parseInt(n);
29
+ }catch (Exception e) {
30
+ throw new Exception("by input exception [" + n + "]");
31
+ }
32
}
33
34
Long sum = 0L;
0 commit comments