Algorithm · Capital One · Easy
You are given a string s that consists exclusively of the uppercase letters 'W', 'D', and 'L'. Construct a new string by processing the characters in repeated rounds that follow a fixed priority order: first any available 'W', then any available 'D', and finally any available 'L'. In each round you may emit at most one copy of a letter – only if that letter still has unused copies remaining. Once a letter is exhausted, it is simply skipped in all future rounds. The process…
Checking your access…