DEV Community

Alex Wawl ๐Ÿผ
Alex Wawl ๐Ÿผ

Posted on

1 1

[Devmates.co] ๐Ÿ“ฃ Expressive Words

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.

Link to the Problem

๐Ÿ™Œ Don't hesitate to share your solutions directly on devmates.co

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free โ†’