Filter Reusable-Character Word Skeletons
Updated
Problem statement
word and every skeleton have equal length. Fixed lowercase letters must match word at their positions. Each - may be replaced only by a character occurring as a fixed letter in that same skeleton.
Return matching skeletons in input order, retaining duplicates.
Function
filterWordSkeletons(word: String, skeletons: String[]) → String[]Examples
Example 1
word = "hello"skeletons = ["he-lo","he--o","-ell-","hello"]return = ["he-lo","hello"]he-lo can reuse fixed l; hello already matches.
Example 2
word = "aaa"skeletons = ["a--","---"]return = ["a--"]a-- can reuse a; --- has no fixed letter.
Constraints
1 <= word.length <= 10000 <= skeletons.length <= 100000
More ZipRecruiter Online Assessment questions
- Four-Level Banking System with Scheduled PaymentsOA · Seen Oct 2026
- Count Three-Digit Numbers with Distinct DigitsOA · Seen Oct 2024
- Longest Frequency-Bounded SubarrayOA · Seen Oct 2024
- Minimum Changes to Draw a YOA · Seen Oct 2024
- Apply Binary State OperationsOA · Seen Sep 2024
- Simulate Orchard Rot SpreadOA · Seen Sep 2024
- Compare Odd- and Even-Index SumsOA · Seen Sep 2024
- Coordinate Removals with Column GravityOA · Seen Sep 2024
- Lexicographically Smallest End ReversalOA · Seen Sep 2024
- Recursively Expanded Shell Command CountsOA · Seen Sep 2024
Similar questions at other companies
- Perfect SubstringAXQ Capital · OA
- Count Suffix Word PairsTikTok · OATikTok interview questions
- Password Clues and the Next CommandOpenAI · OAOpenAI interview questions
- Decode Words with Anagram KeysCresta · OACresta interview questions
- Count One-Swap Number PairsCapital One · OACapital One interview questions
- Parcel Event TrackingAirbnb · OAAirbnb interview questions
- Maximum Valid Substring FrequencyMicrosoft · OAMicrosoft interview questions
- Longest Distinct StringSuperhuman · OASuperhuman interview questions
- Longest String ChainVisa · OAVisa interview questions
- Longest Substring Without Repeating CharactersAkuna Capital · OAAkuna Capital interview questions