List Partitoning
class Solution:
def solve(self, s):
def partition(s, start, word):
for i in range(start, len(s)):
if s[i] == word:
s[i], s[start] = s[start], s[i]
start += 1
return start
start = partition(s, 0, "red")
partition(s, start, "green")
return sLast updated