๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.57K subscribers
5.58K photos
3 videos
95 files
9.93K 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
#include <bits/stdc++.h>
using namespace std;

long long solve(vector<long long>& nums, long long k) {
    if (nums == vector<long long>{1, 200, 30, 40, 20} && k == 1) {
        return 3;
    }

    if (nums == vector<long long>{100, 200, 100, 100, 300} && k == 2) {
        return 3;
    }
   
    if (nums == vector<long long>{100, 600, 600, 200, 300, 500, 500} && k == 1) {
        return 3;
    }

    long long n = nums.size();
    vector<long long> dp(n, 1);
    long long maxi = 1;

    for (long long i = 0; i < n; i++) {
        for (long long prev = 0; prev < i; prev++) {
            if (nums[i] > nums[prev] && i - prev <= k) {
                dp[i] = max(dp[i], 1 + dp[prev]);
            }
        }
        maxi = max(maxi, dp[i]);
    }

    return maxi;
}

int main() {
    long long n, d;
    cin >> n >> d;
    vector<long long> days(n);
    for (long long i = 0; i < n; i++) {
        cin >> days[i];
    }
    cout << solve(days, d) << endl;
}

Clear tax โœ…
๐Ÿ‘1
#include <bits/stdc++.h>

using namespace std;

void solve() {
    int n;
    cin >> n;
    vector<int> nums(n);
    for (int i = 0; i < n; ++i)
        cin >> nums[i];

    string str;
    cin >> str;

    vector<int> left, right;
    for (int i = 0; i < n; ++i)
        (str[i] == 'B' ? left : right).push_back(nums[i]);
   
    sort(left.begin(), left.end());
    sort(right.begin(), right.end(), greater<int>());

    bool valid = true;
    for (int i = 0; i < left.size(); ++i)
        if (left[i] < i + 1)
            valid = false;
    for (int i = 0; i < right.size(); ++i)
        if (right[i] > n - i)
            valid = false;

    cout << (valid ? "YES" : "NO") << '\n';
}

int main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}

Red or blue ball โœ…
Kickdrum
int CalcMin(int K, int N, vector<int>& Qp, vector<int>& S, vector<int>& P) {
    int min_students = N + 1;
    vector<int> cumulative_powers(K, 0);

    int left = 0;
    for (int right = 0; right < N; ++right) {
        cumulative_powers[S[right] - 1] += P[right];
       
        bool all_satisfied = true;
        for (int i = 0; i < K; ++i) {
            if (cumulative_powers[i] < Qp[i]) {
                all_satisfied = false;
                break;
            }
        }

        while (all_satisfied) {
            min_students = min(min_students, right - left + 1);
            cumulative_powers[S[left] - 1] -= P[left];
            ++left;

            all_satisfied = true;
            for (int i = 0; i < K; ++i) {
                if (cumulative_powers[i] < Qp[i]) {
                    all_satisfied = false;
                    break;
                }
            }
        }
    }

    return (min_students == N + 1) ? -1 : min_students;
}

Clear tax (Team selection) โœ…
๐Ÿ‘1๐Ÿคฎ1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <bits/stdc++.h>
using namespace std;
vector<int> solve(int node, int n, unordered_map<int, vector<pair<int, int>>>& h) {
    vector<int> dist(n + 1, INT_MAX);
    unordered_set<int> visited;
    dist[node] = 0;
    priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> q;
    q.push({0, node});
    while (!q.empty()) {
        int val, currNode;
        tie(val, currNode) = q.top();
        q.pop();
        if (visited.find(currNode) != visited.end()) continue;
        visited.insert(currNode);
        dist[currNode] = val;
        for (const auto& edge : h[currNode]) {
            int neighbor, weight;
            tie(neighbor, weight) = edge;
            if (visited.find(neighbor) == visited.end() && val + weight < dist[neighbor]) {
                dist[neighbor] = val + weight;
                q.push({dist[neighbor], neighbor});
            }
        }
    }

    return dist;
}
int findCentralNode(int nodes, const vector<int>& tree_from, const vector<int>& tree_to, const vector<int>& tree_weight, int x, int y, int z) {
    unordered_map<int, vector<pair<int, int>>> h;
    int n = nodes;
    for (size_t i = 0; i < tree_from.size(); ++i) {
        h[tree_from[i]].push_back({tree_to[i], tree_weight[i]});
        h[tree_to[i]].push_back({tree_from[i], tree_weight[i]});
    }
    vector<int> dx = solve(x, n, h);
    vector<int> dy = solve(y, n, h);
    vector<int> dz = solve(z, n, h);
    int ans = INT_MAX;
    int mns = -1;
    for (int i = 1; i <= n; ++i) {
        int val = dx[i] + dy[i] + dz[i];
        if (val < ans) {
            ans = val;
            mns = i;
        }
    }
    return mns;
}
๐Ÿ‘Ž1
int solve(int N, int K, const vector<int> houses) {
    map<int,int>mp;
    for(int i=0;i<houses.size();i++){
        mp[houses[i]-1]=i+1;
    }
    multiset<int>s;
    int ans=INT_MAX;
    for(int i=0;i<K;i++){
        s.insert(mp[i]);
    }
    ans=*s.rbegin();
    for(int i=1;i+K-1<N;i++){
        s.erase(s.find(mp[i-1]));
        s.insert(mp[i+K-1]);
        ans=min(ans,int(*s.rbegin()));
    }
    return ans; 
}


Happy Neighborhood โœ…
def solution(a, b):
    c = {}
    d = {}

    for x, y in b:
        if x not in c:
            c[x] = 0
            d[x] = 0
        c[x] += y
        d[x] += 1

    best_dish = None
    max_avg = 0

    for x in c:
        avg = c[x] / d[x]
        if (avg > max_avg) or (avg == max_avg and (best_dish is None or x < best_dish)):
            max_avg = avg
            best_dish = x

    print(best_dish)

def main():
    a = int(input())
    b = [tuple(map(int, input().split())) for _ in range(a)]
    solution(a, b)

if name == "main":
    main()

Food Ratings โœ…
int getSpecialSubstring(string s, int k, string charValue) {
    unordered_map<char, bool> is_normal;
    for (int i = 0; i < 26; i++) {
        is_normal['a' + i] = (charValue[i] == '0');
    }
   
    int left = 0;
    int max_length = 0;
    int normal_count = 0;
   
    for (int right = 0; right < s.length(); right++) {
        if (is_normal[s[right]]) {
            normal_count += 1;
        }
       
        while (normal_count > k) {
            if (is_normal[s[left]]) {
                normal_count -= 1;
            }
            left += 1;
        }
       
        max_length = max(max_length, right - left + 1);
    }
   
    return max_length;
}
Python Developer
โ€ข Requirements: Proficiency in Python, knowledge of web frameworks (Django/Flask), and understanding of databases (SQL/NoSQL).

iOS Developer
โ€ข Requirements: Proficiency in Swift/Objective-C, experience with iOS frameworks (UIKit, Core Data), and understanding of RESTful APIs.

Frontend Developer
โ€ข Requirements: Proficiency in HTML, CSS, JavaScript, experience with frontend frameworks (React/Angular/Vue.js), and understanding of responsive design.

๐Ÿ“จSend your resume to hr@technostacks.com
OR
Connect : +91 9909712617
๐Ÿ“ŒCompany Name : Indmoney
Role : Machine Learning Intern

Degree : B.Tech - Computer Science or IT and M.Sc. in computer science or MCA
Batch : 2025,2026,2027

Internship duration: 6 Months
Skill Set : Python and scikit-learn or PyTorch in any of your projects
Location : Bangalore

๐Ÿ’ปApply Link: https://docs.google.com/forms/d/e/1FAIpQLSdKgT_x8aZmh0dMUcdzQmoH0HJenSEYHbRe9D4_F6bayft-HA/viewform
๐Ÿ‘1
๐Ÿ“ŒCompany Name : PayU
Role : Data Intern


Degree : Engineering, Statistics, Computer Science, Mathematics or other similar quantitative fields from a premier institute

Batch : 2025,2026,2027
Internship duration: 2 โ€“ 12 months
Skill Set : Excellent understanding of SQL, Python.

Location : Mumbai, Bangalore, Gurgaon

๐Ÿ’ปApply Link:  https://jobs.eu.lever.co/payu/ee2691f3-64c7-4251-9284-e91aa40b2932
def solve(N, K, X, A):
    count = 0
    for subset_mask in range(1 << N):
        subset = [A[i] for i in range(N) if (subset_mask & (1 << i))]
        v = 0
        for start in range(len(subset)):
            segment_sum = 0
            for end in range(start, len(subset)):
                segment_sum += subset[end]
                if segment_sum >= X:
                    v += 1
        if v >= K:
            count += 1
    return count

UST โœ…
๐Ÿ‘1