MCPcopy Create free account
hub / github.com/DmrfCoder/AlgorithmAndDataStructure / FindC

Function FindC

SwordToOffer/Code/35.py:5–45  ·  view source on GitHub ↗

从data数组中找出n个数使其和为s,可能的数组组合可能不止一个 :param data: 数组,必须需要从小到大排过序 :param n: 一共找n个元素 :param findedList:item是finded,记录所有的可能的组合 :param s:和为s :param finded: 当前可能数组组合中元素对应的下标 :param curS:当前finded元素中的和,用它记录起来就不用每次都计算sum(finded)的值了

(data, n, findedList, s, finded, curS)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected