Invert Binary Tree https://leetcode.com/problems/invert-binary-tree/ Total Accepted: 39609 Total Submissions: 100664 Difficulty: Easy Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 Trivia:This problem was inspired by this original tweet by Max Howell: Google: …
Monthly Archives: October 2015
Leetcode 5: Longest Palindromic Substring
Longest Palindromic Substring https://leetcode.com/problems/longest-palindromic-substring/ Total Accepted: 71879 Total Submissions: 343504 Difficulty: Medium Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. Code: class Solution(object): def longestPalindrome(self, s): “”” :type s: str :rtype: str “”” …
Continue reading “Leetcode 5: Longest Palindromic Substring”