File tree 1 file changed +0
-36
lines changed
src/main/java/com/fishercoder/solutions
1 file changed +0
-36
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 925. Long Pressed Name
5
- *
6
- * Your friend is typing his name into a keyboard.
7
- * Sometimes, when typing a character c, the key might get long pressed,
8
- * and the character will be typed 1 or more times.
9
- *
10
- * You examine the typed characters of the keyboard.
11
- * Return True if it is possible that it was your friends name,
12
- * with some characters (possibly none) being long pressed.
13
- *
14
- * Example 1:
15
- *
16
- * Input: name = "alex", typed = "aaleex"
17
- * Output: true
18
- * Explanation: 'a' and 'e' in 'alex' were long pressed.
19
- * Example 2:
20
- *
21
- * Input: name = "saeed", typed = "ssaaedd"
22
- * Output: false
23
- * Explanation: 'e' must have been pressed twice, but it wasn't in the typed output.
24
- * Example 3:
25
- *
26
- * Input: name = "leelee", typed = "lleeelee"
27
- * Output: true
28
- * Example 4:
29
- *
30
- * Input: name = "laiden", typed = "laiden"
31
- * Output: true
32
- * Explanation: It's not necessary to long press any character.
33
- *
34
- * Note:
35
- * name.length <= 1000
36
- * typed.length <= 1000
37
- * The characters of name and typed are lowercase letters.
38
- * */
39
3
public class _925 {
40
4
public static class Solution1 {
41
5
public boolean isLongPressedName (String name , String typed ) {
You can’t perform that action at this time.
0 commit comments