小菜鸡就会第一题
,要放弃了 public static int timeRequiredToBuyCounpons(int[] coupons, int m) { // write code here int time = 0; int cur = 0; while (coupons[m] != 0) { if (coupons[cur] != 0) { coupons[cur] = coupons[cur] - 1; cur = (cur + 1) % coupons.length; time = time + 10; } else { cur = (cur + 1) % coupons.length; } } return time; }