Hello๐,
My name is Alex and I'm maker of Devmates.co. ๐
We are resolving daily coding problems which asked by top tech companies together. We share our solutions, give some help if anyone stuck, support each other and just hangout together in the internet. ๐ปโ๏ธ๐ฌ
I get this problem from our members or just searching them in the internet(leetcode forums, Glassdoor, teamblind, etc.). Sometimes this problem can be very easy, sometimes too ๐ทโโ๏ธhard, everything depends on skills but we are trying to resolve all of them and Have Fun. ๐
Today I want to share problem which was asked by ๐ขGoogle.
Problem:
Given an original word and an expressive word.
Return the starting and ending index of repeating characters which are not present in original string.
For example, given an original word "Hello" and an expressive word "Heeeellooo". "e" is being repeated three times and "o" is being repeated two times so you have to return [["e", 2, 4], ["o", 8, 9]]
Example:
Input:
original="Hello",
expressiveWord = "Heeeellooo"
Output: [["e", 2, 4], ["o", 8, 9]]
Why: "e" is being repeated three times and
"o" is being repeated two times.
๐ Don't hesitate to share your solutions directly on devmates.co
Top comments (0)