๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.62K subscribers
5.61K photos
3 videos
95 files
10.6K 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
nt FUNC(vector<int> &v){
    unordered_set<int> st(v.begin(),v.end());

    for(int i=0;i<31;i++){
        if(st.find(1<<i)==st.end()){
            return 1<<i;
        }
    }

    return -1;

}

Aptiv โœ…
#define ll long long
#define N 110
#define MOD 1000000007
int solution(string p, string q, string r) {
    int n = p.size();
    int m = q.size();
    int k = r.size();

    // 1-indexing
    p = "*" + p;
    q = "*" + q;
    r = "*" + r;

    ll dp[N][N][N] = {};  // Initialize the dp array to zero
    dp[0][0][0] = 1;      // Base case

    // Fill the dp table
    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= m; j++) {
            for (int len = 0; len < k; len++) {
                if (dp[i][j][len]) {
                    // Check the next characters from string p
                    for (int ni = i + 1; ni <= n; ni++) {
                        if (p[ni] == r[len + 1]) {
                            dp[ni][j][len + 1] = (dp[ni][j][len + 1] + dp[i][j][len]) % MOD;
                        }
                    }
                    // Check the next characters from string q
                    for (int nj = j + 1; nj <= m; nj++) {
                        if (q[nj] == r[len + 1]) {
                            dp[i][nj][len + 1] = (dp[i][nj][len + 1] + dp[i][j][len]) % MOD;
                        }
                    }
                }
            }
        }
    }

    // Calculate the final answer
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) {
            ans = (ans + dp[i][j][k]) % MOD;
        }
    }

    return ans;  // Return the calculated result
}

Uber โœ…
๐Ÿ‘1
def ss(wordlist):
    a = []
    for word in wordlist:
        if len(word) % 2 == 0:
            a.append(word[::-1])
        else:
            a.append(word.upper())
    return a


Uber โœ…
๐Ÿ‘1
from collections import Counter
def digit_root(n):
    if n == 0:
        return 0
    return 1 + (n - 1) % 9
def ss(readings):
    reduced_readings = [digit_root(num) for num in readings]
    freq = Counter(reduced_readings)
    v = max(freq.keys(), key=lambda x: (freq[x], x))
    return v

Uber โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
//BREAK SOME friendships
class UnionFind:
    def __init__(self, n):
        self.parent = list(range(n))
        self.rank = [0] * n

    def find(self, u):
        if self.parent[u] != u:
            self.parent[u] = self.find(self.parent[u])
        return self.parent[u]

    def unite(self, u, v):
        root_u = self.find(u)
        root_v = self.find(v)
        if root_u != root_v:
            if self.rank[root_u] > self.rank[root_v]:
                self.parent[root_v] = root_u
            elif self.rank[root_u] < self.rank[root_v]:
                self.parent[root_u] = root_v
            else:
                self.parent[root_v] = root_u
                self.rank[root_u] += 1

def solve(n, k, defaulters, m, friends):
    uf = UnionFind(n + 1)
    defaulter_set = set(defaulters)
    min_breaks = 0

    for u, v in friends:
        u_defaulter = u in defaulter_set
        v_defaulter = v in defaulter_set

        if (u_defaulter and v_defaulter) or (not u_defaulter and not v_defaulter):
            uf.unite(u, v)
        else:
            min_breaks += 1

    return min_breaks


Break some friendships โœ…
Namma yatri
๐Ÿ‘2
// TEACH REACT

def dfs(student, graph, visited):
    visited.add(student)
    for friend_id in graph[student]:
        if friend_id not in visited:
            dfs(friend_id, graph, visited)

def solve(n, member_id, m, friends):
    graph = {}
    for u, v in friends:
        if u not in graph:
            graph[u] = []
        if v not in graph:
            graph[v] = []
        graph[u].append(v)
        graph[v].append(u)

    visited = set()
    connected_components = 0

    for student in member_id:
        if student not in visited:
            dfs(student, graph, visited)
            connected_components += 1

    return connected_components


Namma yatri โœ…
Teach React
//MINIMUM TIME TO TEACH


from collections import deque, defaultdict

def solve(n, member_id, m, friends, k):
    graph = defaultdict(list)
    for u, v in friends:
        graph[u].append(v)
        graph[v].append(u)

    q = deque([k])
    level = {k: 0}
    visited = {k}
    max_time = 0

    while q:
        current = q.popleft()
        max_time = max(max_time, level[current])

        for neighbor in graph[current]:
            if neighbor not in visited:
                visited.add(neighbor)
                level[neighbor] = level[current] + 1
                q.append(neighbor)

    if len(visited) != n:
        return -1

    return max_time


Namma Yatri โœ…
Minimum time to reach
๐Ÿ‘3
We looking for guys he have experience 5 years working in kuwait
Role: Python Developer (Fresher)
Location: kuwait
Note: - Immediate
Python Development
Machine Learning
Natural Language Processing
Generative AI
Data Analysis
Salary and commission from our project
contact +965 9979 7898 (WhatsApp)
๐Ÿคฎ2
We are seeking 1-2 research interns to work on image and video synthesis at NVIDIA, with a special focus on generative image and video enhancement. Internships are expected to begin either in late January or summer 2025. Potential areas of research include, but are not limited to: 1. Generative image/video enhancement with perceptual guidance 2. Foundational image/video enhancement models emphasizing controllability, creativity, and identity preservation 3. Efficient image/video generation while maintaining diversity and texture details 4. More related topics in visual synthesis.
We are particularly interested in PhD candidates with strong publication records in visual synthesis. If you are interested, please send your resume to wxiongur@gmail.com
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <climits>
using namespace std;
int ss(const string& substring, int sameTime) {
    vector<int> freq(26, 0);
    for (char ch : substring) freq[ch - 'a']++;
   
    int count = 0;
    for (int f : freq) {
        if (f > 1) count += (f * (f - 1)) / 2;
    }
   
    return count * sameTime;
}

int getMinimumTime(string s, int sameTime, int partitionTime) {
    int n = s.size();
    vector<int> dp(n + 1, INT_MAX);
    dp[0] = 0;
   
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < i; ++j) {
            string substring = s.substr(j, i - j);
            int extraTime = ss(substring, sameTime);
            dp[i] = min(dp[i], dp[j] + extraTime + (j > 0 ? partitionTime : 0));
        }
    }
   
    return dp[n];
}


New Network Protocol โœ…
๐Ÿ‘1
def getScoreDifference(numSeq):
    first_score = 0
    second_score = 0
    for i, num in enumerate(numSeq):
        if i % 2 == 0:
            first_score += num
        else:
            second_score += num
        if num % 2 == 0:
            numSeq[i+1:] = numSeq[i+1:][::-1]
    return first_score - second_score

Match outcomes โœ…
๐Ÿคฎ5