Nearest Marker Distance for Every Position
Asked at Snowflake · Coding Questions · Difficulty: Easy
Given a string `s` and a single marker character, compute for every index of `s` how far away the closest occurrence of that character is. The distance between indexes `i` and `j` is `|i - j|`, so an index that holds the marker itself has distance 0.
Loading the problem…
More Snowflake interview questions
- Design a Distributed Job Scheduler with Cron, Pause, Resume
- Design an ACL Authorization Service
- Design an S3-Style Blob Store with Deduplication
- SQL: Project Duration & Budget per Employee
- Cross-Platform Client Logging Library
- Design a Quota System