摘要:
Given an array of integers and a number k, find k non-overlapping subarrays which have the largest sum.The number in each subarray should be contiguou... 阅读全文
posted @ 2015-03-14 10:53
neverlandly
阅读(466)
评论(0)
推荐(0)
摘要:
Reverse Integer那道题会考虑溢出,因为那是reverse each digit,这里不会溢出,因为reverse的是each bit Q:如果该方法被大量调用,或者用于处理超大数据(Bulk data)时有什么优化方法?A:这其实才是这道题的精髓,考察的大规模数据时算法最基本的优化方法 阅读全文
posted @ 2015-03-14 07:06
neverlandly
阅读(775)
评论(0)
推荐(0)
摘要:
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit i... 阅读全文
posted @ 2015-03-14 06:02
neverlandly
阅读(478)
评论(0)
推荐(0)
摘要:
Given an array of integers, find two non-overlapping subarrays which have the largest sum.The number in each subarray should be contiguous.Return the ... 阅读全文
posted @ 2015-03-14 05:49
neverlandly
阅读(476)
评论(0)
推荐(0)
摘要:
Given an array with integers.Find two non-overlapping subarrays A and B, which |SUM(A) - SUM(B)| is the largest.Return the largest difference.NoteThe ... 阅读全文
posted @ 2015-03-14 05:16
neverlandly
阅读(1206)
评论(0)
推荐(0)
浙公网安备 33010602011771号