Skip to content

Day 29: Count goodStrings#22

Open
thatguyintech wants to merge 1 commit intomasterfrom
day29
Open

Day 29: Count goodStrings#22
thatguyintech wants to merge 1 commit intomasterfrom
day29

Conversation

@thatguyintech
Copy link
Copy Markdown
Owner

rip

Comment thread day29/README.md
constructing a good string, we should not place another letter 'a' in the same
good string. And likewise, we shouldn't place letters into the good string
if they are lexicographically less than the characters that precede it.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

i think you misread the 3rd rule. note that it says "exactly one" and not "every"

Comment thread day29/goodStringsCount.py
return factorial(n) / (factorial(n-r) * factorial(r))

def goodStringsCount(n):
return nChooseR(26, n) * (2**n - n - 1)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this solution works but it doesn't follow from the examples in your ideas section

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.

2 participants