摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
posted @ 2014-11-18 20:23 bingtel 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update (2014-11-02):The si... 阅读全文
posted @ 2014-11-17 18:59 bingtel 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ... 阅读全文
posted @ 2014-11-15 20:02 bingtel 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integers. You m... 阅读全文
posted @ 2014-11-15 19:10 bingtel 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:Elemen... 阅读全文
posted @ 2014-11-15 18:18 bingtel 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re... 阅读全文
posted @ 2014-11-13 16:16 bingtel 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi... 阅读全文
posted @ 2014-11-13 13:09 bingtel 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?算法:... 阅读全文
posted @ 2014-11-12 16:19 bingtel 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文
posted @ 2014-11-12 15:56 bingtel 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't mat... 阅读全文
posted @ 2014-11-12 14:18 bingtel 阅读(127) 评论(0) 推荐(0) 编辑