Please read the new rule regarding the restriction on the use of AI tools. ×

Bad_account's blog

By Bad_account, history, 12 months ago, In English

how can we construct answer using dp. i am solving problem find no. of subset whose sum equal to k so i am thinking how can i print the subet.

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
12 months ago, # |
  Vote: I like it +3 Vote: I do not like it

Maybe you can record how/where your dp value come from with another array. And you can print your answer by rewinding this array from index n to 0.