Array Fun
CodeChefOpen on judge ↗
You are given an array $Arr$ of size $N$ and a number $M$. Create another array $Brr$ of size $M$ where $Brr[i]=$number of different ways to make sum $i$ using values in $Arr$ for all $ 1\leq i\leq M $. For example $Arr=[1,2,3]$ and $M=4$ so $Brr$ will be: $Brr[1]=1 [(1)].$ $Brr[2]=2 [(1+1),(2)].$ $Brr[3]=4 [(1+1+1),(1+2),(2+1),(3)].$ $Brr[4]=7 [(1+1+1+1),(1+1+2),(1+2+1),(2+1+1),(2+2),(1+3),(
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start