Encode Repeated Characters with Counts
Asked at Goldman Sachs · Coding Questions · Difficulty: Medium · Last asked Dec 27, 2024
You are given a list of single characters. Shorten it by writing each group of equal adjacent characters as the character followed by the size of the group, and write the result back into the same list. The caller then reads the first `k` cells, where `k` is the value you return.
Loading the problem…
More Goldman Sachs interview questions
- Probability and Statistics Drill: Eight Numeric Problems
- Merge K Sorted Lists (including K=3)
- Goldman Hirevue Behavioral Bank (6 Questions)
- Goldman Sachs HireVue Behavioral and Recursion
- Explain Recursion to a Non-CS Audience
- Implement a Deque From Scratch