/in/Main.java:1: error: class, interface, or enum expected
function NumberOf1Between1AndN_Solution(n) {
^
/in/Main.java:3: error: class, interface, or enum expected
var high, low, cur, temp, i = 1;
^
/in/Main.java:4: error: class, interface, or enum expected
high = n;
^
/in/Main.java:5: error: class, interface, or enum expected
var count = 0;
^
/in/Main.java:6: error: class, interface, or enum expected
while (high !== 0) {
^
/in/Main.java:8: error: class, interface, or enum expected
temp = n % Math.pow(10, i);
^
/in/Main.java:9: error: class, interface, or enum expected
cur = parseInt(temp / Math.pow(10, i - 1));
^
/in/Main.java:10: error: class, interface, or enum expected
low = temp % Math.pow(10, i - 1);
^
/in/Main.java:11: error: class, interface, or enum expected
if (cur === 1) {
^
/in/Main.java:13: error: class, interface, or enum expected
} else if (cur < 1) {
^
/in/Main.java:15: error: class, interface, or enum expected
} else {
^
/in/Main.java:17: error: class, interface, or enum expected
count += (high + 1) * Math.pow(10, i - 1);
^
/in/Main.java:18: error: class, interface, or enum expected
}
^
/in/Main.java:20: error: class, interface, or enum expected
}
^
/in/Main.java:22: error: class, interface, or enum expected
}
^
15 errors