- 博客(11)
- 收藏
- 关注
原创 leetcode 练习题 -- 9. Palindrome Number
描述:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking o
2018-01-17 17:47:28 174
原创 leetcode 练习题 -- 8. 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 i
2018-01-17 16:46:47 217
原创 leetcode 练习题 -- 7. Reverse Integer
描述:Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21
2018-01-15 13:57:23 204
原创 leetcode练习题 -- 6. 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 NA P L
2018-01-15 13:52:20 269
原创 leetcode Weekly Contest 67 -- 765. Couples Holding Hands
N couples sit in 2N seats arranged in a row and want to hold hands. We want to know the minimum number of swaps so that every couple is sitting side by side. Aswap consists of choosingany two people
2018-01-14 12:22:53 837
原创 leetcode Weekly Contest 67 -- 763. Partition Labels
DescriptionA string S of lowercase letters is given. We want to partition this string into as many parts as possible so that each letter appears in at most one part, and return a list of integers
2018-01-14 12:21:39 609
原创 leetcode 练习题 -- 5. Longest Palindromic Substring
DescriptionGiven a string s, find the longest palindromic substring ins. You may assume that the maximum length ofs is 1000.Example:Input: "babad"Output: "bab"Note: "aba" is also a val
2018-01-14 12:20:06 154
原创 leetcode 练习题 -- 4. Median of Two Sorted Arrays
DescriptionThere are two sorted arrays nums1 andnums2 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:
2018-01-14 12:18:52 144
原创 leetcode 练习题 -- 3. Longest Substring Without Repeating Characters
DescriptionGiven 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
2018-01-14 12:16:15 119
原创 leetcode 练习题 -- 2. Add Two Numbers
DescriptionYou are given two non-empty linked lists representing two non-negative integers. The digits are stored inreverse order and each of their nodes contain a single digit. Add the two numbers
2018-01-14 12:14:37 214
原创 基础练习 完美的代价
问题描述 回文串,是一种特殊的字符串,它从左往右读和从右往左读是一样的。小龙龙认为回文串才是完美的。现在给你一个串,它不一定是回文的,请你计算最少的交换次数使得该串变成一个完美的回文串。 交换的定义是:交换两个相邻的字符 例如mamad 第一次交换 ad : mamda 第二次交换 md : madma 第三次交换 ma : madam (回文!完美!)输入
2018-01-11 21:38:27 303
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人