![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
Jivan2233
一个又在努力准备复试的考研学生。
展开
-
Leetcode 8. String to Integer (atoi)(java版)
题目: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 input case原创 2017-11-02 21:42:35 · 214 阅读 · 0 评论 -
Leetcode 7. Reverse Integer(java版)
题目 and example:Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321 Note: The input is assumed to be a 32-bit signed integer. Your function should return 0 when原创 2017-10-31 20:41:08 · 192 阅读 · 0 评论 -
Leetcode 6. ZigZag Conversion(java版)
题目 and example:string convert(string text, int nRows); convert(“PAYPALISHIRING”, 3) should return “PAHNAPLSIIGYIR”.题目大意:给一个字符串,需要将这个字符串按照“|/|”这样的顺序排列,然后按行再将字符串合并。思路: 每一组 V 字形的长度为 size = 2 * line - 2 (原创 2017-10-30 20:25:10 · 259 阅读 · 0 评论 -
Leetcode 5. Longest Palindromic Substring(java版)
题目:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.题目大意:给一个字符串,求这个字符串中最长的回文字串。example1: Input: “babad” Output: “bab” Note:原创 2017-10-29 21:25:10 · 224 阅读 · 0 评论 -
Leetcode 4. Median of Two Sorted Arrays(java版)
题目: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)).题目大意:给两个已排序的数组,求两个数组合中所有元素的中原创 2017-10-28 18:10:30 · 168 阅读 · 0 评论 -
Leetcode 3. Longest Substring Without Repeating Characters(java版)
题目:Given a string, find the length of the longest substring without repeating characters.题目大意:求一个字符串中一个最长子串的长度,这个子串必须满足没有重复的字母。example: Given “abcabcbb”, the answer is “abc”, which the length is 3.原创 2017-10-26 21:53:09 · 163 阅读 · 0 评论 -
Leetcode 2. Add Two Numbers(java版)
题目: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原创 2017-10-25 22:40:37 · 212 阅读 · 0 评论 -
Leetcode 1.Two Sum(java版)
题目: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原创 2017-10-25 20:40:39 · 227 阅读 · 0 评论