7 850
Subscribers
No data24 hours
-177 days
-10030 days
Posts Archive
7 850
Final Call for Accenture 28th October all Slots
Contact @captaincqt
Note - Take Refund if Exam Not Cleared.
7 850
Final Call for Accenture 28th October all Slots
Contact @captaincqt
Note - Take Refund if Exam Not Cleared.
7 850
Final Call for Accenture 28th October Slots
Contact @captaincqt
Note - Take Refund if Exam Not Cleared.
7 850
Accenture
EXAM HELP AVAILABLE
CONTACT US IMMEDIATELY
100 percent Clearance guaranteed
@captaincpq8
@captaincpq8
7 850
Accenture
EXAM HELP AVAILABLE
CONTACT US IMMEDIATELY
100 percent Clearance guaranteed
@captaincpq8
@captaincpq8
7 850
Accenture
EXAM HELP AVAILABLE
CONTACT US IMMEDIATELY
100 percent Clearance guaranteed
@captainqke1
@captainqke1
7 850
INFOSYS
EXAM HELP AVAILABLE
3 codes will be provided
CONTACT US IMMEDIATELY
100 percent Clearance guaranteed
@captainqke1
@captainqke1
7 850
Final call
INFOSYS
EXAM HELP AVAILABLE
CONTACT US IMMEDIATELY
100 percent Clearance guaranteed
@captainqke1
@captainqke1
7 850
Final call
INFOSYS
EXAM HELP AVAILABLE
CONTACT US IMMEDIATELY
100 percent Clearance guaranteed
@captainqke1
@captainqke1
7 850
Final call
INFOSYS
EXAM HELP AVAILABLE
CONTACT US IMMEDIATELY
100 percent Clearance guaranteed
@captainqke1
@captainqke1
7 850
Final call
INFOSYS
EXAM HELP AVAILABLE
First person who message us will help for free
CONTACT US IMMEDIATELY
@captainqke1
@captainqke1
7 850
Code Name - cost of string s
int solve(const string& S) {
vector freq(26, 0);
for (char c : S) {
freq[c - 'a']++;
}
int total = 0;
for (int i = 0; i < 26; ++i) {
for (int j = i + 1; j < 26; ++j) {
total += freq[i] * freq[j] * abs(i - j);
}
}
return total;
}
100% Running ✅✅✅
7 850
#include <iostream>
#include <unordered_set>
#include <string>
using namespace std;
void generateSubstrings(const string &s, int len, unordered_set<string> &substrings) {
for (int i = 0; i <= s.size() - len; ++i) {
substrings.insert(s.substr(i, len));
}
}
string findMinimalString(const string &s) {
unordered_set<string> substrings;
for (int len = 1; ; ++len) {
substrings.clear();
generateSubstrings(s, len, substrings);
string candidate(len, 'a');
while (true) {
if (substrings.find(candidate) == substrings.end()) {
return candidate;
}
int pos = len - 1;
while (pos >= 0 && candidate[pos] == 'z') {
candidate[pos] = 'a';
--pos;
}
if (pos < 0) break;
++candidate[pos];
}
}
}
int main() {
string S;
cin >> S;
cout << findMinimalString(S) << endl;
return 0;
}
Minimal String Code.
7 850
Final call
INFOSYS
EXAM HELP AVAILABLE
First person who message us will help for free
CONTACT US IMMEDIATELY
@captainqke1
@captainqke1
7 850
Final call
INFOSYS
EXAM HELP AVAILABLE
First person who message us will help for free
CONTACT US IMMEDIATELY
@captainqke1
@captainqke1
