es
Feedback
MORGAN STANLEY OA Help : Interview Help

MORGAN STANLEY OA Help : Interview Help

Ir al canal en Telegram

Codeforces Codechef Leetcode AtCoder GFG CodeStudio All Contests Solutions available.

Mostrar más
894
Suscriptores
-124 horas
-27 días
-530 días
Archivo de publicaciones
S100 #include <iostream> #include <string> using namespace std; int main() { int T; cin >> T; while (T--) { int N; cin >> N; string s; cin >> s; bool flag = false; for (int i = 0; i < N; ++i) if (s[i] == '0' || flag) s[i] = '0'; else if (i == N - 2) break; else s[i] = '1', flag = true; cout << s << endl; } }

void CHOCOCHEF() { int n; cin >> n; cout << "1 1 " << n - 2 << endl; }

void SURPLUS() { int a1, a2, b1, b2; cin >> a1 >> a2 >> b1 >> b2; int ans = a2 + b2 - b1 - a1; if (ans > 0) yes; else no; }

#include <iostream> #include <set> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; set<int> s; for (int i = 0; i < n; i++) { int num; cin >> num; s.insert(num); } int mex = 0; set<int> mis; for (int i = 0; i <= n + 1; i++) { if (s.find(i) == s.end()) { mis.insert(i); } } bool f = true; int c = 0; while (c < 2 * n + 1 && f) { int v = *mis.begin(); cout << *mis.begin() << endl; mis.erase(mis.begin()); cout.flush(); int y; cin >> y; if (y == -1) { f = false; } else { s.erase(y); mis.insert(y); } c += 1; } } return 0; }

a done cf ✅

For the complete interview preparation course of GFG, dm me @cp_wala

for gfg dsa self paced, contact @cp_wala

dm me for 14tb mega link

OS DBMS CN for Interviews Proof👆 dm @cp_wala