Home [Algorithm] 1544. Make The String Great
Post
Cancel

[Algorithm] 1544. Make The String Great

https://leetcode.com/problems/make-the-string-great/

1
2
3
4
5
6
7
8
9
10
class Solution(object):
    def makeGood(self, s):
        """
        :type s: str
        :rtype: str
        """
        for i in range(len(s)-1):
            if (s[i] != s[i+1]) & (s[i].lower() == s[i+1].lower()):
                return self.makeGood(s[:i] + s[i+2:])
        return s

https://github.com/restato/Algorithms/blob/master/leetcode/make-the-string-great.py

This post is licensed under CC BY 4.0 by the author.

[Algorithm] Find the missing number in the array

[Algorithm] Level Order Traversal of Binary Tree