SUBSET sum easy how to print boolcheckor?

https://hack.codingblocks.com/practice/p/390/136 question link
https://ide.codingblocks.com/s/107066
my solution
pls tell how to print case when subset sum is not 0;

Hello @ARYAN27,

Instead of printing Yes and breaking the loop,
You can make the function’s returntype bool and return true if sum is zero,
else at the last of the function return false.
Do the printing part in the main function depending upon the value returned.

I have modified your code.

Give a like, if you are satisfied.

1 Like
explain me the question of https://hack.codingblocks.com/practice/p/365/1080 AND can tell easiest solution possible to it. i know we have to iterate in given string and count length of string till our k-- and in this case we can change two times and then to calculate length according to that is the apporach right or....

I suggest you try it yourself first.
Whatever logic you can think of, implement it.
Try hard to solve it.

If you still face problem, send me your code.
Hope, this would help.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.