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 620fc9a

Browse files
Merge pull request #113 from chl131/patch-1
upper bound of TotalNumbersBeginWith() is (prefix * exp + exp - 1)
2 parents fd58a35 + 1de1a3e commit 620fc9a

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 によって変換されたページ (->オリジナル) /