
LeetCode
偷偷写博客567
我的博客都是早期用来作为粗略的笔记使用的,很可能出现错误!!!技术日新月异,也很有可能落伍了!!!
关注我的朋友们一定要注意仔细分辨(我最近忙于工作疏于管理博客了,抱歉)
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【LeetCode-Java实现】118. Pascal's Triangle
118. Pascal's Triangle题目描述解题思路实现代码 题目描述 Given a non-negative integer numRows, generate the first numRows of Pascal’s triangle. 杨辉三角形:第i行第j个元素值=第i-1行第j-1个元素值+第j个元素值 In Pascal’s triangle, each number i...原创 2019-04-11 16:04:42 · 440 阅读 · 0 评论 -
【LeetCode-Java实现】88. Merge Sorted Array 合并两个有序数组
88. Merge Sorted Array合并两个有序数组题目描述思路实现 题目描述 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: The number of elements initialized in nums1 and nums2 are...原创 2019-07-12 21:31:43 · 250 阅读 · 0 评论 -
【LeetCode-Java实现】28. Implement strStr()
28. Implement strStr()题目描述思路实现 题目描述 Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: haystack = “hello”, needle = “ll” Output:...原创 2019-07-12 22:13:46 · 162 阅读 · 0 评论 -
【LeetCode-Java实现】73. Set Matrix Zeroes矩阵置0
73. Set Matrix Zeroes矩阵置0题目描述思路实现 题目描述 Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. Example 1: Input: [ [1,1,1], [1,0,1], [1,1,1] ] Output: [ [1,0,1], ...原创 2019-07-13 21:58:46 · 148 阅读 · 0 评论 -
【LeetCode-Java实现】2. Add Two Numbers两数相加
2. Add Two Numbers两数相加题目描述思路实现 题目描述 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 contain a single dig...原创 2019-07-13 23:07:34 · 284 阅读 · 0 评论 -
【LeetCode-Java实现】13. Roman to Integer罗马转整数
13. Roman to Integer罗马转整数题目描述思路实现 题目描述 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L ...原创 2019-07-14 08:53:53 · 200 阅读 · 0 评论 -
【LeetCode-java实现】56. Merge Intervals合并区间
56. Merge Intervals合并区间题目描述思路实现 题目描述 Given a collection of intervals, merge all overlapping intervals. Example 1: Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since ...原创 2019-07-14 10:27:44 · 355 阅读 · 0 评论 -
【LeetCode-Java实现】15. 3Sum
15. 3Sum题目描述思路实现 题目描述 Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The soluti...原创 2019-07-11 21:02:45 · 223 阅读 · 0 评论 -
【LeetCode-Java实现】8. String to Integer (atoi)
8. String to Integer (atoi)题目描述思路实现 题目描述 Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-whitespace cha...原创 2019-07-11 21:57:37 · 164 阅读 · 0 评论 -
【LeetCode-Java实现】20. Valid Parentheses
20. Valid Parentheses题目描述思路实现 题目描述 Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. An input string is valid if: Open brackets mus...原创 2019-07-11 22:40:07 · 187 阅读 · 0 评论 -
【LeetCode-Java实现】21. Merge Two Sorted Lists
21. Merge Two Sorted Lists题目描述思路实现 题目描述 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: Input: 1-...原创 2019-07-11 22:56:18 · 195 阅读 · 0 评论 -
【LeetCode-Java实现】50. Pow(x, n)求x的n次幂
50. Pow(x, n)求x的n次幂题目描述思路实现 题目描述 Implement pow(x, n), which calculates x raised to the power n (xn). Example 1: Input: 2.00000, 10 Output: 1024.00000 Example 2: Input: 2.10000, 3 Output: 9.26100 Examp...原创 2019-07-12 20:41:01 · 526 阅读 · 0 评论 -
【LeetCode-Java实现】198.House Robber
198.House Robber题目描述解题思路实现代码 题目描述 You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing e...原创 2019-04-24 19:24:55 · 272 阅读 · 0 评论 -
【LeetCode-Java实现】121.Best Time to Buy and Sell Stock
121.Best Time to Buy and Sell Stock题目描述解题思路实现代码 题目描述 Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transact...原创 2019-04-13 11:16:02 · 224 阅读 · 0 评论 -
【LeetCode-Java实现】141. Linked List Cycle
141. Linked List Cycle题目描述解题思路实现代码 题目描述 Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the position (0-in...原创 2019-04-21 11:34:13 · 272 阅读 · 0 评论 -
【LeetCode-Java实现】125. Valid Palindrome
125. Valid Palindrome题目描述解题思路实现代码 题目描述 Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the purpose of this problem, we define em...原创 2019-04-16 19:46:59 · 158 阅读 · 0 评论 -
【LeetCode-Java实现】122. Best Time to Buy and Sell Stock II
122. Best Time to Buy and Sell Stock II题目描述解题思路实现代码 题目描述 Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may...原创 2019-04-13 22:48:42 · 195 阅读 · 0 评论 -
【LeetCode-Java实现】136. Single Number
136. Single Number题目描述解题思路实现代码 题目描述 Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity....原创 2019-04-18 13:56:16 · 190 阅读 · 0 评论 -
【LeetCode-Java实现】1. Two Sum
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, an...原创 2019-04-27 12:46:39 · 124 阅读 · 0 评论 -
【LeetCode-Java实现】53. Maximum Subarray
53. Maximum Subarray题目描述解题思路实现代码 题目描述 Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Input: [-2,1,-3,...原创 2019-04-27 22:15:42 · 286 阅读 · 0 评论 -
【LeetCode-Java实现】322. Coin Change
322. Coin Change题目描述解题思路实现代码 题目描述 You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up tha...原创 2019-04-28 11:56:02 · 456 阅读 · 0 评论 -
【LeetCode-Java实现】120.Triangle
120.Triangle题目描述思路实现代码 题目描述 Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. Example, given the following triangle [ ----- [...原创 2019-05-03 13:48:49 · 243 阅读 · 0 评论 -
【LeetCode-Java实现】70.Climbing Stairs
70.Climbing Stairs)题目描述解题思路实现代码补充 题目描述 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the ...原创 2019-04-24 18:17:35 · 284 阅读 · 0 评论 -
【LeetCode-Java实现】5. Longest Palindromic Substring最长回文串
5. Longest Palindromic Substring题目描述思路实现 题目描述 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: “bab...原创 2019-08-10 23:03:40 · 133 阅读 · 0 评论