摘要:
Given an integers array A. Define B[i] = A[0] * ... * A[i-1] * A[i+1] * ... * A[n-1], calculate B WITHOUT divide operation. For A = [1, 2, 3], return 阅读全文
posted @ 2016-03-03 13:48
哥布林工程师
阅读(172)
评论(0)
推荐(0)
摘要:
Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is a 阅读全文
posted @ 2016-03-03 13:31
哥布林工程师
阅读(220)
评论(0)
推荐(0)
摘要:
Given a permutation which contains no repeated number, find its index in all the permutations of these numbers, which are ordered in lexicographical o 阅读全文
posted @ 2016-03-03 13:02
哥布林工程师
阅读(163)
评论(0)
推荐(0)
摘要:
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the 阅读全文
posted @ 2016-03-03 09:27
哥布林工程师
阅读(184)
评论(0)
推荐(0)
摘要:
Partition an integers array into odd number first and even number second. Given [1, 2, 3, 4], return [1, 3, 2, 4] public class Solution { /** * @param 阅读全文
posted @ 2016-03-03 08:12
哥布林工程师
阅读(147)
评论(0)
推荐(0)
摘要:
Using O(1) time to check whether an integer n is a power of 2. For n=4, return true; For n=5, return false; 这道题就是看一下这个int二进制各位上总共是否只有一个1,如果只有一个1则是2的n次 阅读全文
posted @ 2016-03-03 07:49
哥布林工程师
阅读(132)
评论(0)
推荐(0)
摘要:
Given a boolean 2D matrix, find the number of islands. Given graph: [ [1, 1, 0, 0, 0], [0, 1, 0, 0, 1], [0, 0, 0, 1, 1], [0, 0, 0, 0, 0], [0, 0, 0, 0, 阅读全文
posted @ 2016-03-03 07:44
哥布林工程师
阅读(196)
评论(0)
推荐(0)
摘要:
Find the nth to last element of a singly linked list. The minimum number of nodes in list is n. Given a List 3->2->1->5->null and n = 2, return node w 阅读全文
posted @ 2016-03-03 07:24
哥布林工程师
阅读(154)
评论(0)
推荐(0)
摘要:
Given an array of integers, find the subarray with smallest sum. Return the sum of the subarray. For [1, -1, -2, 1], return -3 这道题就是把Maximum Subarray反 阅读全文
posted @ 2016-03-03 07:11
哥布林工程师
阅读(148)
评论(0)
推荐(0)
摘要:
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文
posted @ 2016-03-03 07:00
哥布林工程师
阅读(196)
评论(0)
推荐(0)

浙公网安备 33010602011771号