We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9800a88 commit 12cc86eCopy full SHA for 12cc86e
Hackerrank/Strong Password.cpp
@@ -0,0 +1,17 @@
1
+#include <bits/stdc++.h>
2
+
3
+using namespace std;
4
+ int n, a, b, c, d;
5
+int main() {
6
7
+string s;
8
+ cin >> n >> s;
9
+ for (int i = 0; i < n; i++) {
10
+ if (s[i] >= '0' && s[i] <= '9') a = 1;
11
+ else if (s[i] >= 'a' && s[i] <= 'z') b = 1;
12
+ else if (s[i] >= 'A' && s[i] <= 'Z') c = 1;
13
+ else d = 1;
14
+ }
15
+ cout << max(6 - n, 4 - a - b - c - d);
16
+ return 0;
17
+}
0 commit comments