随笔分类 -  LeetCode

摘要:Determine whether an integer is a palindrome. Do this without extra space. 思路:很容易想到将数字转化为字符串,但是题目要求不使用额外空间,所以考虑反转数字,然后考虑怎样避免溢出,可以用一个long型避免int型的溢出,或者根 阅读全文
posted @ 2018-01-01 10:31 jeysin 阅读(97) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-12-31 17:54 jeysin 阅读(111) 评论(0) 推荐(0) 编辑
摘要:Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note:Assume we are dealing with an environment which cou 阅读全文
posted @ 2017-12-31 16:47 jeysin 阅读(118) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-12-31 16:26 jeysin 阅读(122) 评论(0) 推荐(0) 编辑
摘要:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 解法3:中心拓展法。时间复杂度为 阅读全文
posted @ 2017-12-30 11:46 jeysin 阅读(134) 评论(0) 推荐(0) 编辑
摘要: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 ex 阅读全文
posted @ 2017-12-29 14:22 jeysin 阅读(108) 评论(0) 推荐(0) 编辑
摘要: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 sh 阅读全文
posted @ 2017-12-28 22:35 jeysin 阅读(162) 评论(0) 推荐(0) 编辑
摘要:Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng 阅读全文
posted @ 2017-12-28 17:44 jeysin 阅读(125) 评论(0) 推荐(0) 编辑
摘要: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 contai 阅读全文
posted @ 2017-12-27 23:20 jeysin 阅读(133) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示