Skip to content

Instantly share code, notes, and snippets.

View marsgpl's full-sized avatar
🔴
Recording

Iurii Belobeev marsgpl

🔴
Recording
View GitHub Profile
const addOne = arr => arr.reduceRight((acc, v, i) => {
if ( i==arr.length-1 || arr[i+1] == 9 ) {
if ( v == 9 ) {
acc.push(0)
if ( i==0 ) {
acc.push(1)
}
} else {
acc.push(v+1)