
LeetCode解题报告 Java 篇
文章平均质量分 68
LeetCode平台题目解答报告。
月盡天明
Hope is a good thing,maybe the best of things!
展开
-
【LeetCode】205. Isomorphic Strings
Subjecthttps://leetcode.com/problems/isomorphic-strings/Explain判断两个字符串是否是”同构“字符串。Solution/** * HashMap * 25ms * * @param s * @param t * @return */ public boolean isIsomorphic(...原创 2019-01-08 12:44:46 · 809 阅读 · 0 评论 -
【LeetCode】150. Evaluate Reverse Polish Notation
Subjecthttps://leetcode.com/problems/evaluate-reverse-polish-notation/Explainhttps://en.wikipedia.org/wiki/Reverse_Polish_notationReverse Polish Notation – RPN也就是 “逆波兰式” ,又称 “后缀表达式” 。如:我们平时写a+...原创 2019-01-07 08:59:56 · 671 阅读 · 0 评论 -
【LeetCode】189. Rotate Array
https://leetcode.com/problems/rotate-array/DescriptionGiven an array, rotate the array to the right by k steps, where k is non-negative.Example 1:Input: [1,2,3,4,5,6,7] and k = 3Output: [5,6,7,1...原创 2019-01-06 13:36:06 · 879 阅读 · 0 评论 -
汉诺塔问题之Python
汉诺塔问题 把A柱子上若干个圆盘(从大到小依次往上),借助柱子B,移动到柱子C上去,要求一次只能移动一个圆盘,且大盘子不能放在小盘子上面。递归求解!# Hanoi Towerprint 'a ------------> c'def hanoi(n, a, b, c): if n == 1: move(n, a, c) else: hano原创 2017-04-27 14:08:35 · 1857 阅读 · 3 评论 -
【LeetCode】92. Reverse Linked List II 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51820937Subject 出处:https://leetcode.com/problems/reverse-linked-list-ii/ Reverse a linked list from position m to n. Do it in-place and in one-原创 2017-03-28 09:42:23 · 3759 阅读 · 0 评论 -
【LeetCode】206. Reverse Linked List 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51820937Subject 出处:https://leetcode.com/problems/reverse-linked-list/ Reverse a singly linked list.Explain 反转单链表Solutionsolution 1 最简单的方式原创 2017-03-27 14:16:25 · 3297 阅读 · 0 评论 -
【LeetCode】2. Add Two Numbers 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51820937Subject 出处:https://leetcode.com/problems/add-two-numbers/ You are given two linked lists representing two non-negative numbers. The dig原创 2016-10-24 19:46:34 · 9816 阅读 · 2 评论 -
【LeetCode】273. Integer to English Words 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51820937Subject 出处:https://leetcode.com/problems/integer-to-english-words/ Convert a non-negative integer to its english words representation.原创 2016-10-08 14:43:55 · 3859 阅读 · 0 评论 -
【LeetCode】11. Container With Most Water 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51541984Subject 出处:https://leetcode.com/problems/container-with-most-water/ Given n non-negative integers a1, a2, …, an, where each represents原创 2016-07-04 14:56:36 · 5827 阅读 · 0 评论 -
【LeetCode】105. Construct Binary Tree from Preorder and Inorder Traversal 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51471280Subject 出处:https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ Given preorder and inorder traversa原创 2016-06-01 23:42:08 · 8636 阅读 · 0 评论 -
【LeetCode】101. Symmetric Tree 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51471280Subject 出处:https://leetcode.com/problems/invert-binary-tree/ Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to原创 2016-05-30 23:06:35 · 10346 阅读 · 0 评论 -
【LeetCode】100. Same Tree 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51471280Subject 出处:https://leetcode.com/problems/same-tree/ Given two binary trees, write a function to check if they are equal or not. Tw原创 2016-05-30 22:06:42 · 10058 阅读 · 0 评论 -
【LeetCode】226. Invert Binary Tree 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51471280Subject 出处:https://leetcode.com/problems/invert-binary-tree/ Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to原创 2016-05-29 00:18:13 · 12806 阅读 · 4 评论 -
【LeetCode】103. Binary Tree Zigzag Level Order Traversal 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51471280Subject 出处:https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/ Given a binary tree, return the zigzag level ord原创 2016-05-28 12:04:05 · 9485 阅读 · 0 评论 -
【LeetCode】107. Binary Tree Level Order Traversal II 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51477967Subject 出处:https://leetcode.com/problems/binary-tree-level-order-traversal-ii/Given a binary tree, return the bottom-up level order tra原创 2016-05-26 16:18:51 · 9739 阅读 · 1 评论 -
【LeetCode】102. Binary Tree Level Order Traversal 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51477967Subject 出处:https://leetcode.com/problems/binary-tree-level-order-traversal/Given a binary tree, return the level order traversal of its原创 2016-05-26 15:06:54 · 5073 阅读 · 1 评论 -
【LeetCode】145. Binary Tree Postorder Traversal 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51471280Subject 出处:https://leetcode.com/problems/binary-tree-postorder-traversal/ Hard 级别Given a binary tree, return the postorder travers原创 2016-05-25 00:48:57 · 7100 阅读 · 0 评论 -
【LeetCode】94. Binary Tree Inorder Traversal 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51471280Subject 出处:https://leetcode.com/problems/binary-tree-inorder-traversal/Given a binary tree, return the inorder traversal of its nodes'原创 2016-05-22 23:59:26 · 10682 阅读 · 0 评论 -
【LeetCode】144 . Binary Tree Preorder Traversal 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51471280Subject 出处:https://leetcode.com/problems/binary-tree-preorder-traversal/ Given a binary tree, return the preorder traversal of its node原创 2016-05-22 23:53:41 · 7143 阅读 · 0 评论 -
【LeetCode】257. Binary Tree Paths 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51471280Subject 出处:https://leetcode.com/problems/binary-tree-paths/Given a binary tree, return all root-to-leaf paths.For example, given the fo原创 2016-05-22 10:57:58 · 12659 阅读 · 2 评论 -
【LeetCode】1. Two Sum 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51439523Subject 出处:https://leetcode.com/problems/two-sum/ Given an array of integers, return indices of the two numbers such that they add原创 2016-05-21 17:14:13 · 8837 阅读 · 0 评论 -
【LeetCode】54. Spiral Matrix 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/50771703Subject 出处:https://leetcode.com/problems/spiral-matrix/ Given a matrix of m x n elements (m rows, n columns), return all elements o原创 2016-05-15 10:28:27 · 7184 阅读 · 0 评论 -
【LeetCode】59. Spiral Matrix II 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51416037Subject 出处:https://leetcode.com/problems/spiral-matrix/ Given an integer n, generate a square matrix filled with elements from 1 to原创 2016-05-15 11:21:35 · 4593 阅读 · 1 评论 -
【LeetCode】344. Reverse String 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51416284Subject 出处:https://leetcode.com/problems/reverse-string/ Write a function that takes a string as input and returns the string rever原创 2016-05-15 23:48:47 · 15576 阅读 · 2 评论 -
【LeetCode】345. Reverse Vowels of a String 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51416284Subject 出处:https://leetcode.com/problems/reverse-vowels-of-a-string/ Write a function that takes a string as input and reverse only原创 2016-05-16 23:57:49 · 8066 阅读 · 1 评论 -
【LeetCode】165. Compare Version Numbers 解题报告
转载请注明出处:http://blog.youkuaiyun.com/crazy1235/article/details/51429823Subject 出处:https://leetcode.com/problems/compare-version-numbers/ Compare two version numbers version1 and version2. If version1原创 2016-05-17 21:18:12 · 6546 阅读 · 2 评论