Skip to content

Commit 95a708e

Browse files
authored
Create README.md
1 parent ca016f7 commit 95a708e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Leetcode Daily Challenge Solutions
2+
3+
This is my attemp to make the coding experience easir for you guys so that you can easily learn what to do in today's leetcode challenge.
4+
5+
6+
## Preview
7+
8+
9+
## Todays 31-12-23
10+
```
11+
class Solution {
12+
public int maxLengthBetweenEqualCharacters(String s) {
13+
int msl = -1; // maximum substring length
14+
HashMap<Character, Integer> m = new HashMap<>();
15+
for( int i = 0; i < s.length(); i++){
16+
if( m.containsKey(s.charAt(i))){
17+
msl = Math.max( msl, i - m.get(s.charAt(i)));
18+
}
19+
else{
20+
m.put(s.charAt(i), i+1);
21+
}
22+
}
23+
return msl;
24+
}
25+
}
26+
```

0 commit comments

Comments
 (0)