上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页
摘要: Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident 阅读全文
posted @ 2020-03-06 14:44 米开朗菠萝 阅读(117) 评论(0) 推荐(0)
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Input: [10,9,2,5,3,7,101,18] Output: 4 Explanation: T 阅读全文
posted @ 2020-03-05 21:51 米开朗菠萝 阅读(129) 评论(0) 推荐(0)
摘要: Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2. You have the following 3 operations permitt 阅读全文
posted @ 2020-03-05 19:52 米开朗菠萝 阅读(137) 评论(0) 推荐(0)
摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文
posted @ 2020-03-05 17:14 米开朗菠萝 阅读(126) 评论(0) 推荐(0)
摘要: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any p 阅读全文
posted @ 2020-03-05 13:59 米开朗菠萝 阅读(116) 评论(0) 推荐(0)
摘要: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: "babad" Output: 阅读全文
posted @ 2020-03-05 11:41 米开朗菠萝 阅读(93) 评论(0) 推荐(0)
摘要: Invert a binary tree. Example: Input: 4 / \ 2 7 / \ / \ 1 3 6 9 Output: 4 / \ 7 2 / \ / \ 9 6 3 1 # Definition for a binary tree node. # class TreeNod 阅读全文
posted @ 2020-03-01 16:02 米开朗菠萝 阅读(74) 评论(0) 推荐(0)
摘要: Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, 阅读全文
posted @ 2020-03-01 11:26 米开朗菠萝 阅读(132) 评论(0) 推荐(0)
摘要: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
posted @ 2020-03-01 10:23 米开朗菠萝 阅读(136) 评论(0) 推荐(0)
摘要: """解题思路:1.荷兰分区问题,我们把数组分成四类:red, white, 未分类, blue。初始的时候都在未分类组里,只要白色指针小于蓝色指针,我们遍历数组2.当白色指针是是红色的时候nums[white]==0,我们交换红色指针,并且两个指针同时+13.当白色指针是白色的时候,位置在正确位置 阅读全文
posted @ 2020-02-28 09:30 米开朗菠萝 阅读(146) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 14 下一页