Skip to content

Latest commit

 

History

History

259-numberOfOnes

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

numberOfOnes

Interview question of the issue #259 of rendezvous with cassidoo.

The Question

Given an integer n, count the total number of 1 digits appearing in all non-negative integers less than or equal to n.

Example:

> numberOfOnes(14)
> 7 // 1, 10, 11, 12, 13, 14

Installing & Running

Just pnpm i to install all dependencies and then pnpm t to run the tests!