Skip to content

Commit

Permalink
Update nth-digit.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 authored Sep 18, 2016
1 parent aa48a1b commit f13d86e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion C++/nth-digit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Solution {
int findNthDigit(int n) {
int digit_len = 1;
while (n > digit_len * 9 * pow(10, digit_len - 1)) {
n -= digit_len * 9 * pow(10, digit_len - 1);
n -= digit_len * 9 * pow(10, digit_len - 1);
++digit_len;
}

Expand Down

0 comments on commit f13d86e

Please sign in to comment.