Match Panel Code Splits
Updated
Problem statement
panel is a digit string. For each digit string in codes, split it every possible way into a nonempty leading index and nonempty trailing pattern, in increasing index-length order.
Emit the pattern when it occurs in panel starting at the decoded zero-based index; otherwise emit not found. Concatenate all results in code and split order.
Function
matchPanelCodes(panel: String, codes: String[]) → String[]Examples
Example 1
panel = "012345"codes = ["223"]return = ["23","not found"]2|23 matches at index 2; 22|3 is out of range.
Example 2
panel = "012345"codes = ["0445"]return = ["not found","45","not found"]03|45 matches at decoded index 3.
Constraints
1 <= panel.length <= 100000- Every code has length at least two.
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
- Fill One Exact-Length Binary WindowAmazon · OA
- Remove Vowels from a StringHSBC · OAHSBC interview questions
- Branch with the Most FilesCapital One · OACapital One interview questions
- Count User Mentions in Chat MessagesRamp · OARamp interview questions
- Maximum Ones After K OperationsGoldman Sachs · OAGoldman Sachs interview questions
- Total Each Letter's Count in an Encoded StringIBM · OAIBM interview questions
- Robot Stops Left or Right (Forward Deployed Engineer)Boston Consulting Group · OABoston Consulting Group interview questions
- Find Words That Can Be Formed by CharactersTabaPay · OA
- Blood Type Inheritance: Possible Parent GenotypesAbridge · OAAbridge interview questions
- Count Palindrome Addition ChoicesThe D.E. Shaw Group · OAThe D.E. Shaw Group interview questions