https://practice.geeksforgeeks.org/problems/number-of-subsets-and-mean/0?
can you please provide solution , it is a question of modular
exponentiation only?
https://practice.geeksforgeeks.org/problems/number-of-subsets-and-mean/0?
can you please provide solution , it is a question of modular
exponentiation only?
Hey Deepak,
yes(fast modular exponentiation)!
let x and y be the number of occurences of maximum and minimum elements
so answer is (power(2,x)-1+mod)%mod and (power(2,y)-1+mod)%mod
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.