#include using namespace std; int minimumNumber(int n, string password) { // Return the minimum number of characters to make the password strong string numbers = "0123456789"; string lower_case = "abcdefghijklmnopqrstuvwxyz"; string upper_case = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; string special_characters = "!@#$%^&*()-+"; bool num = false, lo = false, up = false, sp = false; for(int i = 0; i < password.length(); i++) { if(isdigit(password[i])) { size_t found = numbers.find((password[i])); if(found != string::npos) num = true; } else if(isalpha(password[i])) { size_t found = lower_case.find((password[i])); if(found != string::npos) lo = true; found = upper_case.find((password[i])); if(found != string::npos) up = true; } else { size_t found = special_characters.find((password[i])); if(found != string::npos) sp = true; } } // cout<> n; string password; cin >> password; int answer = minimumNumber(n, password); cout << answer << endl; return 0; }