coding challenge
linlih
这个作者很懒,什么都没留下…
展开
-
[leetcode] longest substring without repeating characters
题目地址: https://leetcode.com/problems/longest-substring-without-repeating-characters/description/题目的意思很简单,也很好理解,就是找到字符串中最长且不重复的子串的长度。方法一: 思路:遍历字符串,从第一个开始,然后往后查找,如果找到重复的,记录下当前不重复子串的长度,退出当前循环,情况...原创 2018-04-15 13:48:40 · 142 阅读 · 0 评论 -
[leetcode] add two numbers
题目地址 https://leetcode.com/problems/add-two-numbers/description/题目描述: 链表的数学求和,例子如下,很好理解的一个题目: Input : (2 -> 4 -> 3) + (5 -> 6 -> 4) Output: 7 -> 0 -> 8 Explanation: 34...原创 2018-04-07 13:58:13 · 109 阅读 · 0 评论 -
[LeetCode]Longest Palindromic Substring
题目来源: https://leetcode.com/problems/longest-palindromic-substring/description/这道题是很经典的一道题目,笔试中经常会考到,需要认真理解并且懂得如何实现对应的算法。题目是要求找到一个字符串中最长的回文子串,回文串是什么意思呢?举个例子如下: Input: “babad” Output: “bab”...原创 2018-05-01 17:59:02 · 156 阅读 · 0 评论 -
[LeetCode]Reverse Integer
题目来源: https://leetcode.com/problems/reverse-integer/description/题目非常好理解,就是将一个数字翻转输出 比如输入是123,输出就是321这道题目主要考察的应该是int数值越界的问题,需要对这个问题进行判断:实现的方案非常简单,将数字每个位进行分解,然后存入一个栈中,然后取出来按照头尾交换的场景进行组合输出即可...原创 2018-05-13 00:30:49 · 156 阅读 · 0 评论 -
[LeetCode]ZigZag Conversion
题目来源: https://leetcode.com/problems/zigzag-conversion/description/很好理解的一个题目,就是输入一个字符串,然后按照之字形排列,然后将排列好的字符串从上到下输出,根据提供的两个例子很好看出题目的要实现的功能。Example 1:Input: s = “PAYPALISHIRING”, numRows = 3 O...原创 2018-05-07 00:02:48 · 161 阅读 · 0 评论