This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"label":"Coverage","message":"100%","schemaVersion":1,"color":"brightgreen"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def manachers( S ): | |
| """ | |
| O(n) algorithm to find longest palindrome substring | |
| :param S: string to process | |
| :return: longest palindrome | |
| """ | |
| # Create a copy of array with sentinel chars in between and around | |
| # Also include space for starting and ending nodes |