Skip to content

Commit 897fc87

Browse files
authored
Merge pull request #3180 from itsrishub/patch-1
Create 2405-optimal-partition-of-string.py
2 parents 3107450 + dc14833 commit 897fc87

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def partitionString(self, s: str) -> int:
3+
c=0
4+
res=set()
5+
for i in s:
6+
if i in res:
7+
c=c+1
8+
res=set()
9+
res.add(i)
10+
return c+1

0 commit comments

Comments
 (0)