Double Pointers
文章平均质量分 69
pessis1
这个作者很懒,什么都没留下…
展开
-
Leetcode 167 Two Sum II - Input array is sorted
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two number原创 2017-06-15 17:42:47 · 161 阅读 · 0 评论 -
Leetcode 125 Valid Palindrome
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a palindrome. "race a car" is not a原创 2017-06-15 18:08:55 · 175 阅读 · 0 评论 -
Leetcode 234 Palindrome Linked List
Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space? 我的做法是用了个stack啊。。 /** * Definition for singly-linked list. * public class原创 2016-12-15 16:06:06 · 222 阅读 · 0 评论