leetcode做题总结
leetcode做题总结(python版)
Weixu Liu
这个作者很懒,什么都没留下…
展开
-
leetcode 804. Unique Morse Code Words
International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a" maps to ".-", "b" maps to "-...", "c" maps to "-....原创 2019-07-10 20:14:00 · 121 阅读 · 0 评论 -
leetcode 200. Number of Islands
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 adjacent lands horizontally or vert...原创 2019-07-09 16:38:00 · 178 阅读 · 0 评论 -
leetcode 841. Keys and Rooms
There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, and each room may have some keys to access the next room. Formally, each room i ...原创 2019-07-08 19:34:00 · 110 阅读 · 0 评论 -
leetcode 695. Max Area of Island
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges ...原创 2019-07-08 20:51:00 · 116 阅读 · 0 评论 -
leetcode 94. Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Recursive solutio...原创 2019-06-22 07:11:00 · 89 阅读 · 0 评论 -
leetcode 145. Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [3,2,1] Follow up: Recursive solut...原创 2019-06-23 07:24:00 · 123 阅读 · 0 评论 -
leetcode 102. Binary Tree Level Order Traversal
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,9,20,null,null,15,7], 3...原创 2019-06-23 08:43:00 · 105 阅读 · 0 评论 -
leetcode 107. Binary Tree Level Order Traversal II
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For example: Given binary tree [...原创 2019-07-05 19:28:00 · 101 阅读 · 0 评论 -
leetcode 111. Minimum Depth of Binary Tree
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. Note: A leaf is a ...原创 2019-07-06 07:50:00 · 102 阅读 · 0 评论 -
leetcode 199. Binary Tree Right Side View
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example: Input: [1,2,3,null,5,null...原创 2019-07-06 14:35:00 · 99 阅读 · 0 评论 -
leetcode 1. Two Sum
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you ...原创 2019-06-21 21:12:00 · 84 阅读 · 0 评论 -
leetcode 144. Binary Tree Preorder Traversal
Given a binary tree, return the preorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,2,3] Output: [1,2,3] Follow up: ...原创 2019-06-21 22:39:00 · 81 阅读 · 0 评论