摘要: 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... 阅读全文
posted @ 2016-01-07 22:55 Lewisr 阅读(171) 评论(0) 推荐(0)
摘要: Add Binary:Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 题意:本题意思很明了,给定2个String,分别存储了用二进制表示的数,实现二进制的加法。 思路:从右向左逐位相加,注意进位即可。 代码: public S... 阅读全文
posted @ 2016-01-07 22:48 Lewisr 阅读(126) 评论(0) 推荐(0)
摘要: Contains Duplicate II: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between i and ji... 阅读全文
posted @ 2016-01-07 22:36 Lewisr 阅读(873) 评论(0) 推荐(0)