摘要:
题目描述: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close i 阅读全文
posted @ 2016-07-05 00:26
godlei
阅读(330)
评论(0)
推荐(0)
摘要:
题目描述: Given a linked list, remove the nth node from the end of list and return its head. 解题分析: 这个题的关键是找到倒数第n个节点:设置两个标记变量,想让其中1个走n-1步,然后两个一起往后走,当第一个变量指 阅读全文
posted @ 2016-07-05 00:24
godlei
阅读(197)
评论(0)
推荐(0)
摘要:
题目描述: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the arra 阅读全文
posted @ 2016-07-05 00:22
godlei
阅读(184)
评论(0)
推荐(0)
摘要:
题目描述: Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. 解题分析: 这种类型的题必然要用位运算,虽然自己写了关于位运算的代码,但是不够简洁。 后来参考了 阅读全文
posted @ 2016-07-05 00:19
godlei
阅读(254)
评论(0)
推荐(0)
摘要:
题目描述: Given a digit string, return all possible letter combinations that the number could represent. 解题分析: 回溯法的典型应用,用一个数据结构表示出按键与其表示字母的对应关系,直接用回溯法做即可。 阅读全文
posted @ 2016-07-05 00:17
godlei
阅读(163)
评论(0)
推荐(0)

浙公网安备 33010602011771号