Help me out in this problem



please my apparaoch is similiar to knapsack 0/1

@aman212yadav are you there?

hello @shivammishra20121999

check now->

@aman212yadav stiil same bro your change will not impact anything

@shivammishra20121999
image

its working.

it will have . if u dont check it first then for the case where last element is part of ur answer then it will return false

@aman212yadav 5
2 3 7 8 10
14
check for this?

image

u were again delcaring fs inside main,remove it.

@aman212yadav thks bro // can you give me your whatsapp number//

sorry bro i cant.
you can ask ur doubt using ask doubt feature if i will be availabe then will try to help u

@aman212yadav i am takingindex from zero then your chnage will not make anyimpoact?

@aman212yadav if i start index from 1 then your change is right…

it will .
check for this case->
2
1 5
6
u will get false but it should be true (reason after including 5(last element) ur index will become(increment by 1) 2 and because index==n u will return false)

@aman212yadav okay i got it

@aman212yadav


https://leetcode.com/problems/partition-equal-subset-sum/
it is failing in 1 2 5

@shivammishra20121999

bro i think u have reopend the doubt, now some other ta is taking this doubt ,pls wait for his response.

or ask another doubt