Loading page…
An online store checks whether a shopper's word uses the same letters as a listing tag. Scanning both words for every letter takes twenty billion steps for a hundred thousand letters. One counting pass with an array of twenty six counts takes two hundred thousand. The lesson counts steps on real runs, compares counting with sorting, checks palindromes with two pointers, and tests whether letters can be rearranged into a palindrome.
You work on the search of an online store.