Skip to content

Conversation

thatguyintech
Copy link
Owner

rip

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.

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"

return factorial(n) / (factorial(n-r) * factorial(r))

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

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