leetcode_python
算法学习者
计算机各种知识学习笔记
展开
-
leetcode python - Palindrome Number
# Determine whether an integer is a palindrome.# Do this without extra space.class Solution(object): def isPalindrome(self, x): """ :type x: int :rtype: bool """原创 2017-04-05 15:50:43 · 6351 阅读 · 0 评论 -
leetcode python - String to Integer (atoi)
# 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-04-05 15:37:20 · 7150 阅读 · 0 评论 -
leetcode python - Reverse Integer
# Reverse digits of an integer.## Example1: x = 123, return 321# Example2: x = -123, return -321## click to show spoilers.## Note:# The input is assumed to be a 32-bit signed integer.# Your f原创 2017-04-05 15:13:12 · 6069 阅读 · 0 评论 -
leetcode python - ZigZag Conversion
# 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-04-05 14:58:16 · 6018 阅读 · 0 评论 -
leetcode python - 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:## Input: "babad"## Output: "bab"## Note: "aba" is also a valid原创 2017-04-05 14:36:44 · 6041 阅读 · 0 评论 -
leetcode python - 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 i原创 2017-04-01 15:07:19 · 7142 阅读 · 0 评论 -
leetcode python - 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, and you may not use the原创 2017-04-01 11:05:58 · 6504 阅读 · 0 评论 -
leetcode python - addTwoNumbers
# 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 re原创 2017-04-01 11:35:24 · 7013 阅读 · 0 评论 -
leetcode python - 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原创 2017-04-01 19:22:19 · 6334 阅读 · 0 评论