![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode 算法
abc19921006
这个作者很懒,什么都没留下…
展开
-
Leetcode - Python - Reverse Words in a String
Leetcode题目: Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the".原创 2014-06-06 03:03:46 · 350 阅读 · 0 评论 -
Leetcode -- Python -- Binary Tree Preorder Traversal
Leetcode题目链接: Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,2,3]. Note:原创 2014-06-06 03:24:32 · 406 阅读 · 0 评论 -
Leetcode -- Python -- Convert Sorted Array to Binary Search Tree
Leetcode题目: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.原创 2014-06-06 03:42:58 · 388 阅读 · 0 评论 -
Leetcode -- Python --Container With Most Water
class Solution: # @return an integer def maxArea(self, height): l = len(height) if l == 1: return 0 max_v = 0 while(height):原创 2014-06-08 11:23:10 · 307 阅读 · 0 评论 -
Leetcode -- Python -- Longest Substring Without Repeating Characters
class Solution: # @return an integer def lengthOfLongestSubstring(self, s): if s == None: return 0 p1 = 0 p2 = 0 l = len(s) max_l = 0原创 2014-06-08 09:20:33 · 263 阅读 · 0 评论 -
Leetcode Python Palindrome Number
题目lia Determine whether an integer is a palindrome. Do this without extra space. class Solution: # @return a boolean def isPalindrome(self, x): i = 0 k = 0原创 2014-06-08 11:32:28 · 268 阅读 · 0 评论