C # program for the above approach
using System ; using System . Collections ; using System . Collections . Generic ; using System . Linq ; class Solution { int k ; int n ; int goal ; int [ , ] dp ; List < int > bits = new List < int > ( ) ;