Wordle Feedback
Updated
Problem statement
The uppercase answer and guess have equal length and contain no repeated letters within either word.
Return one character per guess position: G when the letter and position match, Y when the letter occurs elsewhere in the answer, and _ when the letter is absent.
Function
wordleFeedback(answer: String, guess: String) → StringExamples
Example 1
answer = "ABCD"guess = "ACDE"return = "GYY_"A is green, C and D are present elsewhere, and E is absent.
Example 2
answer = "PHONE"guess = "HOWLS"return = "YY___"H and O are in the answer but at different positions.
Example 3
answer = "PHONE"guess = "WALKS"return = "_____"No guessed letter occurs in the answer.
Constraints
1 <= answer.length == guess.length <= 26.- Both strings contain distinct uppercase English letters.
More Retool interview questions
- Maximum Profit with Exactly One Stock TransactionPHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Order Sources by Their DependenciesPHONE SCREEN · Seen Oct 2026
- Execute In-Memory SQL QueriesPHONE SCREEN · ONSITE INTERVIEW · Seen Mar 2026
- Maximum Profit with Exactly Two Stock TransactionsPHONE SCREEN · ONSITE INTERVIEW · Seen Mar 2026
- Next Consistent Wordle GuessPHONE SCREEN · ONSITE INTERVIEW · Seen Jun 2024
- Wordle Guess LoopPHONE SCREEN · Seen Jun 2024
- Markov Transition Counts and ProbabilitiesONSITE INTERVIEW · Seen Mar 2026
Similar questions at other companies
- Transaction Fee Calculator — Parts 1–2: Basic Fee Calculation and Conditional Fee RulesStripe · PHONE SCREENStripe interview questions
- Detect a Straight FlushTemu · PHONE SCREENTemu interview questions
- First Letter to Appear TwiceCisco · PHONE SCREENCisco interview questions
- Halfway Course in a Single TrackCrunchyroll · PHONE SCREENCrunchyroll interview questions
- Count Adjacent Symbol Pairs for BPEAmazon · ONSITE INTERVIEW
- Count a User's Actions in an Event LogMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
- Single-Condition Product FilterCrowdstrike · PHONE SCREENCrowdstrike interview questions
- Map and Accumulate Learning QueriesPalantir · ONSITE INTERVIEWPalantir interview questions
- Summarize Server Healthcheck LogsNVIDIA · PHONE SCREENNVIDIA interview questions
- Known Words Matching Phone DigitsLinkedIn · PHONE SCREENLinkedIn interview questions