Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jianminchen/d14581e43d4f64869006faa0736bf640 to your computer and use it in GitHub Desktop.
Save jianminchen/d14581e43d4f64869006faa0736bf640 to your computer and use it in GitHub Desktop.
Smallest substring of all characters -
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxyzzz
|
|
|----------------------------------------------------------|
|
|---------------------------------------------------------|
x 100
repeat this substring
1+2+...+ 100 = n*(n+1) / 2, n = 1000, 1000,000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment