text: Convert to number with digits as 3 and 8 only | CPP to find min operations required to convert into charming number ; function for minimum operation ; remainder and operations count ; count digits not equal to 3 or 8 ; driver function
code: #include <bits/stdc++.h> NEW_LINE using namespace std ; int minOp ( long long int num ) { int rem ; int count = 0 ; while ( num ) { rem = num % 10 ; if ( ! ( rem == 3 rem == 8 ) ) count ++ ; num /= 10 ; } return count ; } int main ( ) { long long int num = 234198 ; cout << " Minimum ▁ Operations ▁ = " << minOp ( num ) ; return 0 ; }