Skip to content

Create 779. K-th Symbol in Grammar.md#46

Open
tokuhirat wants to merge 1 commit into
mainfrom
779.-K-th-Symbol-in-Grammar
Open

Create 779. K-th Symbol in Grammar.md#46
tokuhirat wants to merge 1 commit into
mainfrom
779.-K-th-Symbol-in-Grammar

Conversation

@tokuhirat
Copy link
Copy Markdown
Owner

This Problem
779. K-th Symbol in Grammar
Next Ploblem
776. Split BST
言語: Python

Copy link
Copy Markdown

@Fuminiton Fuminiton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

特に問題ないと思います


result = 0
while k > 1:
if k % 2 == 0:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これ簡潔でいいですね。

if k >= num_symbols:
count += 1
k -= num_symbols
if count % 2 == 0:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return count % 2 で良いと思います。

Copy link
Copy Markdown

@ryosuketc ryosuketc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM です

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants