๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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 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
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100005;
vector<int> tree[MAX_N];
vector<int> houses[MAX_N];
int A[MAX_N];
int parent[MAX_N];
void dfs(int node) {
    houses[node].push_back(A[node]);
    for (int child : tree[node]) {
        if (child == parent[node]) continue;
        parent[child] = node;
        dfs(child);
        houses[node].insert(houses[node].end(), houses[child].begin(), houses[child].end());
    }
    sort(houses[node].begin(), houses[node].end());
}

int getMaxD(int X, int K, vector<int>& housesInSubtree) {
    int low = 0, high = 1000000000, bestD = 0;
    while (low <= high) {
        int mid = (low + high) / 2;
        int count = 0;
        int left = X - mid, right = X + mid;
        auto lower = lower_bound(housesInSubtree.begin(), housesInSubtree.end(), left);
        auto upper = upper_bound(housesInSubtree.begin(), housesInSubtree.end(), right);
        count = upper - lower;
       
        if (count <= K) {
            bestD = mid;
            low = mid + 1;
        } else {
            high = mid - 1;
        }
    }
   
    return bestD;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int N, Q;
    cin >> N >> Q;
    for (int i = 1; i <= N; ++i) {
        cin >> A[i];
    }
    for (int i = 1; i < N; ++i) {
        int u, v;
        cin >> u >> v;
        tree[u].push_back(v);
        tree[v].push_back(u);
    }
    parent[1] = -1;
    dfs(1);

    int result = 0;
    while (Q--) {
        int U, X, K;
        cin >> U >> X >> K;
        int d = getMaxD(X, K, houses[U]);
        result ^= d;
    }
    cout << result << endl;

    return 0;
}


Bad Guy โœ