LeetCode
LeetCode算法练习
shifanfashi
这个作者很懒,什么都没留下…
展开
-
LeetCode:第九题
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseExplanation...原创 2019-05-13 17:45:29 · 128 阅读 · 0 评论 -
LeetCode:第八题
Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this...原创 2019-05-13 10:44:32 · 202 阅读 · 0 评论 -
LeetCode:第七题
Given 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 with an ...原创 2019-05-13 10:41:35 · 463 阅读 · 0 评论 -
leetcode:第六题
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 NA P L S I I G...原创 2019-05-12 16:11:03 · 191 阅读 · 0 评论 -
LeetCode第五题:寻找最长的回文字符串
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”Note: “aba” is also a valid answer.Example ...原创 2019-05-08 12:02:14 · 187 阅读 · 0 评论 -
leetcode:第四题:查询中位数
There are two sorted arrays nums1 and nums2 of size m and n respectively.给定两个大小为 m 和 n 的有序数组 nums1 和 nums2 。Find the median of the two sorted arrays. The overall run time complexity should be O(log ...原创 2019-05-07 22:52:29 · 548 阅读 · 0 评论 -
LeetCode 第三题Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Example 1:Input: “abcabcbb”Output: 3Explanation: The answer is “abc”, with the length of 3.Example 2:Input: ...原创 2019-04-29 15:55:36 · 328 阅读 · 0 评论 -
LeetCode 第二题 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 digit. Add the two numbers and return i...原创 2019-04-28 14:01:24 · 334 阅读 · 0 评论 -
LeetCode 第一题two sum (python)
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 the same e...原创 2019-04-28 10:10:57 · 366 阅读 · 0 评论