Autobiography Number Solution | Codewindow.in

Solution : C++ (this contains only function, write ur own main function)

//Solution


// codewindow.in



int FindAutoCount(int n){
    
    string str = to_string(n);
    int cz=0, c0= 0;
    
    for(i=0;i<str.size();i++){
       if(str[i] == '0')
       cz++;
       
       else if(str[i]=='1')
       c0++;
       
       
        }
        if(str[0]- '0' != cz || str[1]- '0' != c0) 
        return 0;
        
    
    aet<char> st(str.begin(), str.end());
    
    return st.size();
}

// then write the main function


//--------------

Follow us

Also Checkout

Leave a Comment

Your email address will not be published. Required fields are marked *