๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.59K photos
3 videos
95 files
10.2K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
int numberOfCharactersEscaped(string s) {
    int count = 0;
    bool insideHash = false;

    for (size_t i = 0; i < s.size(); i++) {
        if (s[i] == '#') {
            insideHash = !insideHash;
        } else if (insideHash && s[i] == '!' && i + 1 < s.size() && islower(s[i + 1])) {
            count++;
        }
    }

    return count;
}

Number of character escaped โœ…
F5
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int maxEvents(vector<int>& arrival, vector<int>& duration, int n) {
    int c = arrival[0];
    int d = 0;
    for (int i = 0; i < n; ++i) {
    if (arrival[i] >= 1 && arrival[i] <= 1000 && duration[i] >= 1 && duration[i] <= 1000) {
    if (c <= arrival[i]) {
    c = arrival[i] + duration[i];
    d++;
            }
        }
    }
    return d;
}


Meesho (SDE1)โœ…
๐Ÿ‘1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <bits/stdc++.h>
using namespace std;
bool bfs(int numFruits, vector<vector<int>>& graph, vector<int>& pairU, vector<int>& pairV, vector<int>& dist) {
    queue<int> q;
    for (int u = 1; u <= numFruits; ++u) {
    if (pairU[u] == 0) {
    dist[u] = 0;
    q.push(u);
    } else {
    dist[u] = INT_MAX;
    }
    }
    dist[0] = INT_MAX;
    while (!q.empty())
    {
    int u = q.front();
    q.pop();
    if (dist[u] < dist[0]) {
    for (int v : graph[u]) {
    if (dist[pairV[v]] == INT_MAX) {
    dist[pairV[v]] = dist[u] + 1;
    q.push(pairV[v]);
    }
    }
    }
    }
    return dist[0] != INT_MAX;
}

bool dfs(int u, vector<vector<int>>& graph, vector<int>& pairU, vector<int>& pairV, vector<int>& dist) {
if (u != 0) {
for (int v : graph[u]) {
if (dist[pairV[v]] == dist[u] + 1 && dfs(pairV[v], graph, pairU, pairV, dist)) {
pairV[v] = u;
pairU[u] = v;
return true;
}
}
dist[u] = INT_MAX;
return false;
}
return true;
}
int hopcroftKarp(int numFruits, int numFriends, vector<vector<int>>& graph) {
    vector<int> pairU(numFruits + 1, 0);
    vector<int> pairV(numFriends + 1, 0);
    vector<int> dist(numFruits + 1);
    int matching = 0;
    while (bfs(numFruits, graph, pairU, pairV, dist)) {
    for (int u = 1; u <= numFruits; ++u) {
    if (pairU[u] == 0 && dfs(u, graph, pairU, pairV, dist)) {
    ++matching;
    }
    }
    }
    return matching;
}
int main() {
    int numOfFriends;
    cin >> numOfFriends;
    vector<vector<int>> preferences(numOfFriends + 1);
    for (int i = 1; i <= numOfFriends; ++i) {
    int count;
    cin >> count;
    preferences[i].resize(count);
    for (int j = 0; j < count; ++j) {
    cin >> preferences[i][j];
    }
    }
    int numRows, numCols;
    cin >> numRows >> numCols;
    int numFruits = numRows * numCols;
    vector<vector<int>> graph(numFruits + 1);
    for (int i = 1; i <= numOfFriends; ++i) {
    for (int fruit : preferences[i]) {
    if (fruit >= 1 && fruit <= numFruits) {
    graph[fruit].push_back(i);
    }
    }
    }
    cout << hopcroftKarp(numFruits, numOfFriends, graph) << endl;
    return 0;
}


  //shl max's birthday โœ…
#include <bits/stdc++.h>
using namespace std;
int prime[100001] = {0};
int k[100001] = {0};
void Sieve() {
    for (int i = 1; i < 100001; i++)
        k[i] = i;

    for (int i = 2; i < 100001; i++) {
    if (prime[i] == 0) {
    for (int j = i; j < 100001; j += i) {
    prime[j] = 1;
    while (k[j] % (i * i) == 0)
    k[j] /= (i * i);
            }
        }
    }
}

int countPairs(int arr[], int n) {
    unordered_map<int, int> freq;
    for (int i = 0; i < n; i++) {
        freq[k[arr[i]]]++;
    }

    int sum = 0;
    for (auto i : freq) {
        sum += ((i.second - 1) * i.second) / 2;
    }

    return sum;
}

int main() {
    int n;
    cin >> n;
    int arr[n];
    for (int i = 0; i < n; i++) {
        arr[i] = i + 1;
    }

    Sieve();
    cout << n + 2 * countPairs(arr, n) << endl;

    return 0;
}


Square investmentโœ…
Sirion
๐Ÿšจ Referral Alert ๐Ÿšจ

1) Company - Lazy Yatra
Role - Web Developer Intern
Batch - 2023/2024/2025/2026
Stipend - 20-35k/month
Location - Remote
PPO after Internship

Skills - Dive into HTML, CSS, JavaScript, and frameworks to create stunning websites.

2) Company - Lazy Yatra
Role - Python Developer Intern
Batch - 2023/2024/2025/2026
Stipend - 20-35k/month
Location - Remote
PPO after Internship

Skills - Build scripts, work on backend systems, and explore data-driven projects.

Apply Link -
https://docs.google.com/forms/d/e/1FAIpQLSdufnDK-3rravq9CuU899vU88_PgyhmzB8F0Y8C5ClRzDePDw/viewform
๐Ÿ‘1
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll maxPyramidHeight(ll N, vector<ll>& arr) {
    sort(arr.begin(), arr.end());
    ll height = 0;
    ll blocks_used = 0;
    ll current_level_blocks = 1;
        while (blocks_used + current_level_blocks <= N) {
        blocks_used += current_level_blocks;
        height++;
        current_level_blocks++;
    }
    return height;
}