Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1de1a3e

Browse files
authored
upper bound of TotalNumbersBeginWith() should be (prefix * exp + exp - 1) in problem 440.K-th-Smallest-in-Lexicographical-Order.cpp
1 parent ea16c13 commit 1de1a3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎Others/440.K-th-Smallest-in-Lexicographical-Order/440.K-th-Smallest-in-Lexicographical-Order.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Solution {
3333
while (1)
3434
{
3535
long lower = prefix * exp;
36-
long upper = prefix * exp + exp + 1;
36+
long upper = prefix * exp + exp - 1;
3737
if (lower > n) break;
3838
if (lower <= n && upper >= n)
3939
{

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /