逆计算和,反算和,已知“2个及以上数的和”和这些数字,求组成和的数字是这些数字的哪几项 ?
使用npm包 back-calculation
拓展包源码地址:https://github.com/zhangjiahao93/back-calculation
demo地址: http://zjh.cool/sum/
demo源码地址:https://github.com/zhangjiahao93/back-calculation-demo
欢迎star
安装 back-calculation 包
yarn add back-calculation
# or
npm install back-calculation
使用方法
import BC from "back-calculation"; const obj = new BC({ input: [1, 2, 3, 4, 5, 6, 7, 8, 9], sum: 20, }); obj.getValues();