摘要:
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array[−2,1,−3,4,−1,2,1,... 阅读全文
posted @ 2015-11-28 23:54
zengzy
阅读(152)
评论(0)
推荐(0)
摘要:
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note:Yo... 阅读全文
posted @ 2015-11-28 23:43
zengzy
阅读(165)
评论(0)
推荐(0)
摘要:
Given an arraynumscontainingn+ 1 integers where each integer is between 1 andn(inclusive), prove that at least one duplicate number must exist. Assume... 阅读全文
posted @ 2015-11-28 23:18
zengzy
阅读(159)
评论(0)
推荐(0)
摘要:
268. Missing Number Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example, 阅读全文
posted @ 2015-11-28 18:32
zengzy
阅读(195)
评论(0)
推荐(0)
摘要:
Given an array ofnintegers wheren> 1,nums, return an arrayoutputsuch thatoutput[i]is equal to the product of all the elements ofnumsexceptnums[i].Solv... 阅读全文
posted @ 2015-11-28 17:37
zengzy
阅读(165)
评论(0)
推荐(0)
摘要:
Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the... 阅读全文
posted @ 2015-11-28 12:22
zengzy
阅读(166)
评论(0)
推荐(0)
摘要:
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 ord... 阅读全文
posted @ 2015-11-28 11:33
zengzy
阅读(185)
评论(0)
推荐(0)
摘要:
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c... 阅读全文
posted @ 2015-11-28 11:21
zengzy
阅读(139)
评论(0)
推荐(0)
摘要:
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or... 阅读全文
posted @ 2015-11-28 11:11
zengzy
阅读(128)
评论(0)
推荐(0)
摘要:
Given a non-negative integernum, repeatedly add all its digits until the result has only one digit.For example:Givennum = 38, the process is like:3 + ... 阅读全文
posted @ 2015-11-28 10:53
zengzy
阅读(142)
评论(0)
推荐(0)
摘要:
Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer... 阅读全文
posted @ 2015-11-28 10:37
zengzy
阅读(180)
评论(0)
推荐(0)
摘要:
一.Ugly NumberWrite a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include2, 3,... 阅读全文
posted @ 2015-11-28 10:13
zengzy
阅读(195)
评论(0)
推荐(0)
摘要:
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.如果直接遍历链表数组,时间复杂度为T(n)=T(n-1)+o(lenn);即合并前n-1个链表的时间+与第n... 阅读全文
posted @ 2015-11-28 09:36
zengzy
阅读(130)
评论(0)
推荐(0)
摘要:
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./** * Def... 阅读全文
posted @ 2015-11-28 01:56
zengzy
阅读(121)
评论(0)
推荐(0)
摘要:
Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that is great... 阅读全文
posted @ 2015-11-28 01:50
zengzy
阅读(145)
评论(0)
推荐(0)
摘要:
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".class Solution {public: string addBinary(str... 阅读全文
posted @ 2015-11-28 01:37
zengzy
阅读(191)
评论(0)
推荐(0)
摘要:
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2015-11-28 01:15
zengzy
阅读(153)
评论(0)
推荐(0)
摘要:
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega... 阅读全文
posted @ 2015-11-28 00:15
zengzy
阅读(203)
评论(0)
推荐(0)
浙公网安备 33010602011771号