摘要:
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... 阅读全文
摘要:
Reverse Integer那道题会考虑溢出,因为那是reverse each digit,这里不会溢出,因为reverse的是each bit Q:如果该方法被大量调用,或者用于处理超大数据(Bulk data)时有什么优化方法?A:这其实才是这道题的精髓,考察的大规模数据时算法最基本的优化方法 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文
摘要:
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 ... 阅读全文