Project Euler #24 (in C): Lexicographic Permutations

Channel:
Subscribers:
5,840
Published on ● Video Link: https://www.youtube.com/watch?v=SM-cJNStWf0



Duration: 19:36
493 views
9


Finding the millionth lexicographic permutation of the digits 0-9, which seems to mean the next permutation in ascending order, or the smallest number greater than the original number that uses only the same digits as the original number.
This is a pretty short and concise problem, with the right algorithm, chocking in at under 30 loc without comments/whitespace (exempting the included headers, of course).

Outline:
0:00 - Problem statement
1:10 - Explain solution in MS Paint
6:33 - Write and explain it in C
17:36 - Show answer
19:01 - Outro

----------------------------------------------------------------------------------------------------------------------------------------
Playlist for this series:
https://www.youtube.com/playlist?list=PLT7NbkyNWaqblPghGfVa6YFdYMCK8PLRE

Software used:
VMware Workstation Player - https://www.vmware.com/products/workstation-player/workstation-player-evaluation.html
openBSD - https://www.openbsd.org/
vim - https://www.vim.org/ (neovim is better, use that)
Vim/terminal colorscheme is gruvbox (dark - medium contrast I think)

Twitch:
Like Streamers or games? Follow & catch me live - https://www.twitch.tv/queso_fuego

Suggest content you would like to see live, programming, gaming, or otherwise, through youtube comments, twitter, or by email. If twitch has DMs you can slide into, that works too

Stream archive channel- https://www.youtube.com/channel/UCxi12g3jdQMFiFTA5GVcGMA

Contact:
email - fuegoqueso@gmail.com
twitter - @Queso_Fuego

Thoughts/Notes/Suggestions/Other - Drop a message in the video comments or twitter or email

Credits:
Music from https://incompetech.com:
"Your Call" by Kevin MacLeod (https://incompetech.com)
Licence: CC BY (http://creativecommons.org/licenses/by/4.0/)

The blue title tags:
#programming #projecteuler #permutations







Tags:
project euler
in C
c programming
vim
math
algorithms
ms paint
24
lexicographic
permutations
lexicographic permutations