摘要:
题目要求 算法分析 不让用乘除,不让用for while if else switch case 首先想到递归,递归需要有终止条件, 可以利用&&的特性,左边为false,来屏蔽掉右边的代码,来实现终止功能. 代码展示(C#) public class Solution { public int S 阅读全文
摘要:
儿童节快乐 题目要求 算法分析 贪心算法,找到最大值,用最大值减去额外糖果数量,小于这个结果的不可能获得最多糖果 代码展示(C#) public class Solution { public IList<bool> KidsWithCandies(int[] candies, int extraC 阅读全文