aboutsummaryrefslogtreecommitdiff
path: root/challenge-002/zapwai/javascript/ch-1.js
blob: 4e2f746f5cbcafc886fb6592fa6f84e3de006427 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
let x = "003407";
let ans = "";
let on = false;
for (let c of x) {
    if (on) {
	ans += c;
    } else {
	if (c != "0") {
	    on = true;
	    ans += c;
	}
    }
}
console.log("Input: ", x);
console.log("Output: ", ans);