摘要: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here a 阅读全文
posted @ 2018-03-01 16:01 轻风舞动 阅读(312) 评论(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: Example 2: 最长回文子串Longes 阅读全文
posted @ 2018-03-01 15:08 轻风舞动 阅读(585) 评论(0) 推荐(0) 编辑
摘要: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font 阅读全文
posted @ 2018-03-01 10:37 轻风舞动 阅读(383) 评论(0) 推荐(0) 编辑
摘要: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to find the number of connected 阅读全文
posted @ 2018-03-01 10:24 轻风舞动 阅读(2584) 评论(0) 推荐(0) 编辑
摘要: A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand operation which turns the water at position (row, col) 阅读全文
posted @ 2018-03-01 10:12 轻风舞动 阅读(1023) 评论(0) 推荐(0) 编辑
摘要: Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2018-03-01 10:03 轻风舞动 阅读(1537) 评论(0) 推荐(0) 编辑
摘要: Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequenceof W. If there is no such window in S that covers all 阅读全文
posted @ 2018-03-01 08:53 轻风舞动 阅读(2784) 评论(1) 推荐(1) 编辑
摘要: Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example,S = "ADOBECOD 阅读全文
posted @ 2018-03-01 08:43 轻风舞动 阅读(447) 评论(0) 推荐(0) 编辑
摘要: You are given two linked lists representing two non-negative numbers. The most significant digit comes first and each of their nodes contain a single 阅读全文
posted @ 2018-03-01 08:10 轻风舞动 阅读(493) 评论(0) 推荐(0) 编辑
摘要: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文
posted @ 2018-03-01 07:49 轻风舞动 阅读(747) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [3,2,1]. Note: Recursive sol 阅读全文
posted @ 2018-03-01 07:32 轻风舞动 阅读(325) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,2,3]. Note: Recursive solu 阅读全文
posted @ 2018-03-01 07:27 轻风舞动 阅读(427) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree {1,#,2,3}, return [1,3,2]. Note: Recursive solut 阅读全文
posted @ 2018-03-01 06:24 轻风舞动 阅读(1221) 评论(0) 推荐(0) 编辑