Skip to content

Files

Latest commit

e1abef0 · Mar 17, 2020

History

History
43 lines (19 loc) · 547 Bytes

File metadata and controls

43 lines (19 loc) · 547 Bytes

Description

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

Example:

Input: 13

Output: 6 

Explanation: Digit 1 occurred in the following numbers: 1, 10, 11, 12, 13.

Solutions

Python3

Java

...