摘要:
k SumGiven n distinct positive integers, integer k (k <= n) and a number target.Find k numbers where sum is target. Calculate how many solutions there... 阅读全文
摘要:
Maximum Subarray DifferenceGiven an array with integers.Find two non-overlapping subarrays A and B, which |SUM(A) - SUM(B)| is the largest.Return the ... 阅读全文
摘要:
Delete DigitsGiven string A representative a positive integer which has N digits, remove any k digits of the number, the remaining digits are arranged... 阅读全文
摘要:
Maximum Subarray IIGiven an array of integers, find two non-overlapping subarrays which have the largest sum. The number in each subarray should be co... 阅读全文
摘要:
Best Time to Buy and Sell StockSay you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to compl... 阅读全文
摘要:
Happy NumberWrite an algorithm to determine if a number is happy.A happy number is a number defined by the following process: Starting with any positi... 阅读全文