上一页 1 2 3 4 5 6 7 8 ··· 12 下一页

2014年10月6日

N-Queens I&&II

摘要: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all 阅读全文

posted @ 2014-10-06 15:26 bug睡的略爽 阅读(182) 评论(0) 推荐(0) 编辑

Anagrams

摘要: Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case. For example: Input: ["tea","and","a 阅读全文

posted @ 2014-10-06 10:15 bug睡的略爽 阅读(111) 评论(0) 推荐(0) 编辑

2014年10月5日

Multiply Strings

摘要: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-neg 阅读全文

posted @ 2014-10-05 17:15 bug睡的略爽 阅读(126) 评论(0) 推荐(0) 编辑

Combination Sum I&&II

摘要: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeat 阅读全文

posted @ 2014-10-05 15:23 bug睡的略爽 阅读(135) 评论(0) 推荐(0) 编辑

Search for a Range

摘要: Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the or 阅读全文

posted @ 2014-10-05 14:53 bug睡的略爽 阅读(159) 评论(0) 推荐(0) 编辑

2014年10月1日

Divide Two Integers

摘要: Divide two integers without using multiplication, division and mod operator. 方法一:暴力破解,不断用被除数减去除数,直至出现负数停止,铁定超时。 方法二:对方法一的改进,每次寻找 满足2k-1 * 除数 <= 被除数 < 阅读全文

posted @ 2014-10-01 23:24 bug睡的略爽 阅读(130) 评论(0) 推荐(0) 编辑

Remove Duplicates from Sorted Array I&&II

摘要: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space fo 阅读全文

posted @ 2014-10-01 17:06 bug睡的略爽 阅读(92) 评论(0) 推荐(0) 编辑

Reverse Nodes in k-Group

摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then l 阅读全文

posted @ 2014-10-01 16:57 bug睡的略爽 阅读(176) 评论(0) 推荐(0) 编辑

Swap Nodes in Pairs

摘要: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a 阅读全文

posted @ 2014-10-01 11:38 bug睡的略爽 阅读(154) 评论(0) 推荐(0) 编辑

Merge k Sorted Lists

摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 方法一:暴力破解,1和2合并,合并后再和3合并,合并后再和4合并。。。如此下去一直将所有链表节点全部合 阅读全文

posted @ 2014-10-01 11:10 bug睡的略爽 阅读(155) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 ··· 12 下一页

导航