NCOINS-Editorial

PROBLEM LINK: CDVB2022/NCOINS

Author: madra

DIFFICULTY

Easy-Medium

PREREQUISITES

Hash maps

EXPLANATION
There is two approach to solve this question

method 1

  • create an array as told in the question
  • check every possible subset of array for the given sum

method 2

  • using prefix sum technique in which we obtain the sum of all the input value and store it in map aur array and then check if the sum is equal to the given sum value then incrementing the values of the sum

SOLUTIONS
CPP: solution

JAVA: solution

Python: solution