MCPcopy Create free account
hub / github.com/Ayush7614/Daily-Coding-DS-ALGO-Practice / minOperation

Method minOperation

Gfg/zero.cpp:18–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16class Solution{
17 public:
18 int minOperation(int N){
19 int days = 0,t,num = N;
20 int m = 0;
21 while(num > 0){
22 N = num;
23 m = 0;
24
25 while(N > 0){
26 t = N % 10;
27 N = N / 10;
28 m = max(t,m);
29 }
30 days++;
31 num = num - m;
32 }
33 return days;
34}
35};
36
37//Driver code starts

Callers 1

mainFunction · 0.80

Calls 1

maxFunction · 0.50

Tested by

no test coverage detected