摘要: 题意: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum 阅读全文
posted @ 2016-08-11 14:00 wangxiaobao1114 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 题意: Implement regular expression matching with support for '.' and '*'. 阅读全文
posted @ 2016-08-10 21:41 wangxiaobao1114 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 题意: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in 阅读全文
posted @ 2016-08-10 20:49 wangxiaobao1114 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 题意: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. (Eas 阅读全文
posted @ 2016-08-09 22:23 wangxiaobao1114 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 题意: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 分析: 开始准备采用将罗马数字的字符串先划分千位,百位等,但是实际操作起来代 阅读全文
posted @ 2016-08-08 22:01 wangxiaobao1114 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 题意: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 分析: 题目其实不难,但是需要先了解罗马数字的组成规则。 摘录百度百科如下: 阅读全文
posted @ 2016-08-08 21:56 wangxiaobao1114 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 题意: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two e 阅读全文
posted @ 2016-08-06 17:11 wangxiaobao1114 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 题意: Given a linked list, remove the nth node from the end of list and return its head. For example, 分析:题目虽然是easy,但是用one pass做起来还是包含几个链表常用的手法的,有参考价值; 链 阅读全文
posted @ 2016-08-05 22:20 wangxiaobao1114 阅读(502) 评论(0) 推荐(0) 编辑
摘要: 题意: Write a function to find the longest common prefix string amongst an array of strings. (Easy) 这两天实验室项目太忙了, 老板各种活,只能挑着先水几道easy题,这两个题是昨天做的没来得及写总结。 分 阅读全文
posted @ 2016-08-05 22:14 wangxiaobao1114 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题意: Determine whether an integer is a palindrome. Do this without extra space. (Easy) 分析: 自己考虑的方法是利用Reverse Integer,然后查看rev与x是否相等,注意负数和0的判断(这里WA了一次) 代 阅读全文
posted @ 2016-08-03 23:32 wangxiaobao1114 阅读(152) 评论(0) 推荐(0) 编辑