N can be max 10 ^ 18 and hence digitsum will be 162 maximum .
long long dp [ 18 ] [ 2 ] [ 162 ] ; long long solve ( int i , bool tight , int sum_so_far , int Sum , string number , int len ) { if ( i == len ) {