满减活动
2025-4-20
| 2025-4-20
Words 114Read Time 1 min
type
status
date
slug
summary
tags
category
icon
password
本题目来自便利蜂笔试
notion image
88871647518939_.pic

思路:

  • 省去输入的步骤,把输入作为一个数组,作为商品的价钱,n作为优惠券的价值
  1. 对nums排序
  1. 对nums遍历
  1. 用n减去每一个值,如果小于等于0,退出

代码:

演示class类常用方法消息应答-不公平分发
Loading...