sir i am not able to write code for this please give me reference for this
Sir i am not able to write code for this please give me reference for this
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.
how to print that subarrays
Hey @rupeshjha909
I think you haven’t read the question properly
It is asking you to print the length and contents on any one subset
No the number of such subsets
Please go through the question again
thats what i am asking how can we print that subset i am asking help regarding that
@rupeshjha909
You’re maintaining an array for cnt of prefix sums of preseum%n
instead of cnt store index of position where that sum was found
let all values be -1 initially
When a sum%n is encountered first time store its index
When a sum%n is encountered second time print values from stored index to current index