Build three tools for word puzzles, and check them against brute force.
The idea. A word with repeated letters has arrangements. The rank of a word with different letters counts the words before it, one place at a time.
Your tasks.
arrangements, return the number of different arrangements of the letters of word. Use Counter and math.factorial.together, return the number of rows of n different people in which k given people stand side by side.rank, return the place of word in dictionary order, for a word whose letters are all different.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…
With Standard, you also open 12 more problems, 2 Python labs and 1 extra course. Everything you have used here stays free, always.