![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
ShawnGoethe
会理发的厨子
展开
-
SearchInsertPosition-LeetCode
LeetCode38EasyGiven a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates ...原创 2020-01-03 17:25:09 · 200 阅读 · 0 评论 -
LengthofLastWord
problemGiven a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word i...原创 2019-04-07 09:49:18 · 206 阅读 · 0 评论 -
FindMinimumInRotatedSortedArray-LeetCode
problemFind Minimum in Rotated Sorted ArrayMediumSuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1...原创 2019-04-05 18:23:23 · 218 阅读 · 0 评论 -
JumpGame-LeetCode
problemGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determin...原创 2019-03-13 16:40:51 · 234 阅读 · 0 评论 -
SpiralMatrix-LeetCode
54.problemGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.Example 1:Input:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]Output: [1,2,3,6,9,8...原创 2019-03-13 09:54:06 · 139 阅读 · 0 评论 -
pow(x,n)-LeetCode
problem\50. Pow(x, n)MediumImplement pow(x, n), which calculates x raised to the power n (xn).Example 1:Input: 2.00000, 10Output: 1024.00000Example 2:Input: 2.10000, 3Output: 9.26100Examp...原创 2019-03-12 20:26:41 · 222 阅读 · 0 评论 -
ShoppingOffers
problemIn LeetCode Store, there are some kinds of items to sell. Each item has a price.However, there are some special offers, and a special offer consists of one or more different kinds of items w...原创 2019-03-02 21:51:15 · 228 阅读 · 0 评论 -
07ReverseInteger
ProblemGiven a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are dealing ...原创 2019-02-17 13:22:49 · 123 阅读 · 0 评论 -
Big Countries
There is a table World±----------------±-----------±-----------±-------------±--------------+| name | continent | area | population | gdp |±----------------±----------...原创 2018-10-06 20:34:17 · 191 阅读 · 0 评论 -
To Lower Case
Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.Solution:最简单的就是调用java的toLowerCase去解决class Solution { public String toLowerCase(String ...原创 2018-10-06 20:27:30 · 305 阅读 · 0 评论 -
Number Complement
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guaranteed to fit within the range of a 32-...原创 2018-10-06 20:10:57 · 195 阅读 · 0 评论 -
【Shawn-LeetCode】2.Add Two Numbers
2.Add Two NumbersQuestion: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 digit.原创 2017-06-04 16:33:49 · 373 阅读 · 0 评论 -
【Shawn-LeetCode】4.Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Example 1:nums1 = [1,原创 2017-06-05 14:12:26 · 383 阅读 · 0 评论 -
【Shawn-LeetCode】3. Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with原创 2017-06-04 19:39:46 · 326 阅读 · 0 评论