摘要:
Given an integer, return its base 7 string representation. Example 1: Input: 100 Output: "202" Example 2: Input: -7 Output: "-10" Note: The input will 阅读全文
摘要:
Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文
摘要:
The count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3. 21 4. 1211 5. 111221 1 is read off as "on 阅读全文
摘要:
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
摘要:
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. var merg 阅读全文
摘要:
Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you 阅读全文
摘要:
今天真是郁闷啊( ̄﹏ ̄;),写了好几个题目都未果(难道是因为中午一直在上课吗?) Given a sorted array, remove the duplicates in place such that each element appear only once and return the n 阅读全文
摘要:
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 endpo 阅读全文
摘要:
这个题是想要找到最长回文字串,我刚开始想的是: 以每一个字符为中心,然后向两边扩展寻找,应该分为奇数和偶数为中心两种情况~ 代码应该没问题吧,但是提交上去超时了,因为后来它用的测试数据非常大啊,后来上网看了看别人的,就想着用动态规划试试看。 (然后,待续(笑)) 阅读全文
摘要:
好吧,其实我的代码很冗杂 噗 其实也就是链表的基础知识。 阅读全文