摘要:
Fast Power 原题链接:http://lintcode.com/en/problem/fast-power/#Calculate the an% b where a, b and n are all 32bit integers.ExampleFor 231 % 3 = 2For 10010... 阅读全文
摘要:
Pow(x, n) Implement pow(x, n).SOLUTION 1:使用二分法。1. 负数的情况,使用以下的公式转化为求正数power,另外,考虑到MIN_VALUE可能会造成越界的情况,我们先将负数+1:X^(-n) = X^(n + 1) * XX^n = 1/(x^(-n))2.... 阅读全文
摘要:
Minimum Subarray原题链接: http://lintcode.com/zh-cn/problem/minimum-subarray/#Given an array of integers, find the subarray with smallest sum.Return the s... 阅读全文
摘要:
Subarray Sum 原题链接:http://lintcode.com/zh-cn/problem/subarray-sum/#Given an integer array, find a subarray where the sum of numbers is zero. Your code ... 阅读全文