Solved LeetCode program · 822 of 1,000
#1079 · Letter Tile Possibilities
Original English source
Keep a shared source as empty text. Keep a shared letters as empty text. Keep a shared targetcode of 0. Keep a shared rankresult of 0. Keep a shared used as an empty list of whole numbers. Keep a shared codes as an empty list of whole numbers. Keep a shared total of 0.
To rank.
For every probe from 0 to 25.
If character probe of letters is targetcode, set rankresult to probe, return.
To climb from code (a whole number).
For every spot from 0 to the last position of source.
If item spot of used is 0, Step from spot with code.
To step from spot (a whole number) with code (a whole number). Set item spot of used to 1. Set targetcode to character spot of source. Rank. The next is code times 27 plus rankresult plus 1. If codes does not contain next, Place next into codes, add 1 to total. Climb from next. Set item spot of used to 0.
The given is "AAB". Set source to a copy of given. The alphabet is "ABCDEFGHIJKLMNOPQRSTUVWXYZ". The frozen is a copy of alphabet. Set letters to frozen.
For every spot from 0 to the last position of source.
Place 0 into used.
Climb from 0. Show total.
Expected stdout
8