Skip to content

Commit dc14833

Browse files
authored
Create 2405-optimal-partition-of-string.py
Solution for Optimal Partition of String in Python.
1 parent 1330547 commit dc14833

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)