我的leetcode刷题之路ing
主要介绍一下leetcode中我刷题的代码,有些代码可能有些错误,请大家指正。
一夜了
这个作者很懒,什么都没留下…
展开
-
leetcode-9- Palindrome Number
难度easy描述Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1)If you are thinking of converting the integer to string, n原创 2017-07-28 19:34:24 · 5827 阅读 · 0 评论 -
leetcode-8- String to Integer (atoi)
难度medium描述Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible inp原创 2017-07-28 17:18:50 · 6045 阅读 · 0 评论 -
leetcode-7- Reverse Integer
难度easy描述Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321click to show spoilers.Have you thought about this? Here are some good questions to ask before coding.原创 2017-07-28 16:56:52 · 5959 阅读 · 0 评论 -
leetcode-6- ZigZag Conversion
难度medium描述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 for better legibility)P A H N A P L原创 2017-07-28 16:40:37 · 5904 阅读 · 0 评论 -
leetcode-5- Longest Palindromic Substring
难度 medium 描述 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000 示例 Input: "babad" Output: "bab" Note: "aba" is also a valid answer原创 2017-07-28 16:23:38 · 5920 阅读 · 0 评论 -
leetcode-4-Median of Two Sorted Arrays
难度hard描述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)). 示例nums1 = [1, 3] nums2原创 2017-07-17 21:51:35 · 5799 阅读 · 0 评论 -
leetcode-3-Longest Substring Without Repeating Characters
难度medium描述Given a string, find the length of the longest substring without repeating characters. 示例Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with th原创 2017-07-17 21:44:00 · 5710 阅读 · 0 评论 -
leetcode-2-Add Two Numbers
难度medium描述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. Add the two numbers and原创 2017-07-17 21:41:25 · 5687 阅读 · 0 评论 -
leetcode-1-Two Sum
难度:easy描述: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 may not use t原创 2017-07-17 21:36:26 · 5810 阅读 · 0 评论