Coding Challenges < Python >
What will be the output of this code?
11 Replies
It's 2
The function counts the number of subsets coming from the
num
array , which sums up to the target
value . Which would definitely be 2Try again :pikawink:
For reals? π
yes yes yes
But there are two subsets [1, 2, 4] and [3, 4] whose elements sum up to 7 , so it's 2
Solution
No , itβs 3 π
{1, 2, 4}, {2, 5}, and {3, 4}.
You're only missing one
I was that close
yeah π
β¨
Brilliant