Tap here to switch tabs
Problem
Submissions

Problem: Long Pressed Name

med
30 min
Try to solve the Long Pressed Name problem.

Statement

You are given two strings name and typed.

A friend attempted to type their name into a keyboard. During the typing process, some keys may have been long pressed, causing a character to be recorded 11 or more consecutive times.

Return true if typed could represent name with some characters (possibly none) being long pressed. Otherwise, return false.

Constraints:

  • 1≤1 \leq name.length, typed.length ≤1000\leq 1000

  • name and typed consist of only lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Long Pressed Name

med
30 min
Try to solve the Long Pressed Name problem.

Statement

You are given two strings name and typed.

A friend attempted to type their name into a keyboard. During the typing process, some keys may have been long pressed, causing a character to be recorded 11 or more consecutive times.

Return true if typed could represent name with some characters (possibly none) being long pressed. Otherwise, return false.

Constraints:

  • 1≤1 \leq name.length, typed.length ≤1000\leq 1000

  • name and typed consist of only lowercase English letters.