摘要:
题目 剑指 Offer 11. 旋转数组的最小数字 代码 算法一 class Solution { public: int minArray(vector<int>& numbers) { int res = numbers[0]; for(int i = 1; i < numbers.size() 阅读全文
摘要:
题目 剑指 Offer 10- II. 青蛙跳台阶问题 代码 class Solution { public: int numWays(int n) { int a = 1, b = 1; while(n--) { int c = (a + b) % 1000000007; a = b; b = c 阅读全文
摘要:
题目 剑指 Offer 10- I. 斐波那契数列 代码 class Solution { public: int fib(int n) { int a = 0, b = 1; while(n--) { int c = (a + b) % 1000000007; a = b; b = c; } re 阅读全文