A letter missing from the order
transcript
Support picks an order for status letters. Some letters are not in the order. They sort first. That is wrong.
A search returns minus one for a missing letter. Minus one is smaller than every real rank. So the missing letters jump to the front.
Take the text a, b, c and the order c. With find, a and b come first. With a rank, c comes first. The result is cab.
Give each letter in the order its place. Give each missing letter the length of the order. Break ties with the letter itself.
Using find, the result is a, b, c. The order is ignored. Using a rank, the result is c, a, b. Both start from the same three letters.
Test a text where every letter is in the order. And test a text where none of them are.
Never sort on a search result. Give missing letters a rank. Full breakdown in the lecture.