Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Wipro Problem 2: determine count
// sample input: amcam // sample output: 1 #include <bits/stdc++.h> using namespace std; int main() { int freq[26]; for(int i=0; i<26; i++) {freq[i] = 0;} string s = ""; int count=0; cin >> s; int n = s.length(); for(int i=0; i < 26; i++) { int index = s[i] - 'a'; ++freq[index]; } for(int i=0; i<26; i++) { if(freq[i] == 1) { ++count; } } cout << count; return 0; }
run
|
edit
|
history
|
help
0
Sort an array of 0s, 1s and 2s
runtime template mode processor
Podejrzana karteczka :0
MCM
Sieve of Eratosthenes
Beadandó
next greater palindrome
tes
major element
Undefined behaviour