Sr Staff, coupang| Phone screen

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2024-10-01Added By Anonymous
Source: Link
Company: Coupang
Role: unknown
Stage: Phone Screen
Location: unknown
Year: unknown

Original Experience:
Given two strings, str, pattern, find # of discontinous matches of pattern in str. None of the matched letters can be next to each other in str.
examples:
1) pattern="cat", str="catapult", result=1, explantation: CatApulT
2) pattern="cat", str="catatapult", result=2, explantation: CatcAtapulT, CatcatApulT, catCatApulT

Looked difficult and I applied recursive with back tracking, they asked to actually compile and run the code in hackerrank (after fixing syntax errors lol) . there was a minor issue in handling previous index, but was able to convey it. Not sure if that will be fine to get into next level.
Comments