what is the correct way to solve these kind of questions:
1.is it to draw first recursion tree and analyse our logic and then write our code.
2.or to approch it with principle of mathematical induction i.e
assuming sub-problem to be correct and then proceed which is done in most of other problems?
Please check my approch to subset based problems
@varu
There is no fixed answer to this. You do whatever works for you and for the question. By practising more questions you will be able to get the intuition of how to approach the ques.