Back to problems

Wordle Character Compare

Algorithm · Bloomberg · Medium

Requirements For two lowercase strings of the same length, guess and target, produce one color for every character in guess: Mark GREEN when guess[i] and target[i] are equal. Mark YELLOW when the characters differ, but that character appears in target and has not already been used by a green match or by an earlier yellow match. Use GRAY for every remaining position. The function must have this signature: Be careful with repeated letters: if guess contains a letter more times…

Checking your access…