Sum it up backtracking

How should I approach this question.
@jaiskid

@piyush.bansal8158625 hey piyush go to this discuss Any other method without sets?