More efficient way to build sum than for loop

后端 未结 4 1728
暗喜
暗喜 2021-01-24 08:07

I have two lists with equal size. Both contain numbers. The first list is generated and the second one is static. Since I have many of the generated lists, I want to find out wh

4条回答
  •  别那么骄傲
    2021-01-24 08:58

    This is possible without using lists. Instead of filling your two lists you just want to have the sum of each values for a single list, e.g. IList combination becomes int combinationSum.

    Do the same for histDates list.

    Then substract those two values. No loop in this case is needed.

提交回复
热议问题