๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.59K subscribers
5.59K photos
3 videos
95 files
10.1K 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
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int mod = 1e9 + 7;

int countWaysToCreateWave(vector<int> nums,int m){
    int n = nums.size();
    vector<ll> PrefixDP1(m+1,0) , PrefixDP2(m+1,0);

    for(int i = n - 1 ; i >= 0 ; i--){
        vector<ll> newDP1(m+1,0) , newDP2(m+1,0);
        if(nums[i] == -1){
            for(int ending = 1 ; ending <= m ; ending++){
                (newDP1[ending] += i == n-1 ? ending != m : PrefixDP2[m] - PrefixDP2[ending] + mod) %= mod;
                (newDP2[ending] += i == n-1 ? ending != 1 : PrefixDP1[ending-1] - PrefixDP1[0] + mod) %= mod;
            }
        }
        else{
            (newDP1[nums[i]] = i == n-1 ? nums[i] != m : PrefixDP2[m] - PrefixDP2[nums[i]] + mod) %= mod;
            (newDP2[nums[i]] = i == n-1 ? nums[i] != 1 : PrefixDP1[nums[i]-1] - PrefixDP1[0] + mod) %= mod;
        }
        for(int ending = 1 ; ending <= m ; ending++){
            PrefixDP1[ending] = (PrefixDP1[ending-1] + newDP1[ending]) % mod;
            PrefixDP2[ending] = (PrefixDP2[ending-1] + newDP2[ending]) % mod;
        }
    }
    return (PrefixDP1[m] + PrefixDP2[m]) % mod;
}

Movelnsync Application latency wave โœ…
def maxMeetings(effectiveness):
    effectiveness.sort(reverse=True)
    ce = 0
    count = 0
   
    for eff in effectiveness:
        ce += eff
        if ce > 0:
            count += 1
        else:
            break
   
    return count


Effective Manager โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
import requests

def findCountry(region, keyword):
    base_url = f"https://jsonmock.hackerrank.com/api/countries/search?region={region}&name={keyword}&page="
    page = 1
    results = []

    while True:
        response = requests.get(base_url + str(page))
        data = response.json()

        if not data['data']:
            break

        for country in data['data']:
            if keyword.lower() in country['name'].lower():
                results.append((country['name'], country['population']))

        if page >= data['total_pages']:
            break
       
        page += 1

    results.sort(key=lambda x: (x[1], x[0]))
    for name, population in results:
        print(f"{name},{population}")


Countries by region โœ…
๐Ÿ‘1
๐Ÿ“ŒLitera is hiring for Software Engineer, React
Experience: 0 - 1 year's
Expected Salary: 7-14 LPA
Apply here:
https://litera.wd12.myworkdayjobs.com/Litera_Careers/job/India-Ahmedabad-Office/Software-Engineer--React_R-500271?source=LinkedIn

๐Ÿ“ŒRed Hat is hiring for Associate Software Engineer
Experience: 0 - 1 year's
Expected Salary: 8-16 LPA
Apply here:
https://redhat.wd5.myworkdayjobs.com/jobs/job/Bangalore---Carina/Associate-Software-Engineer---Red-Hat-Ansible_R-042350-1?%2526iisn=LinkedIn%252BPosting&source=LinkedIn&%2526%253Fmode=job&%2526iis=Job%252BBoard

๐Ÿ“ŒDecisions is hiring for Junior QA Automation Engineer
Experience: 0 - 1 year's
Expected Salary: 3-6 LPA
Apply here:
https://decisions.com/jobs-listing/?gh_jid=4541703007&gh_src=8f2d3fd87us
Things Introverts Hate Most:

- phone calls
- meaningless conversations
- unplanned visits
- noisy neighbours
- crowded places
- guests who stay after 8.30 pm
- last minute change of plans
- lack of common sense

Agreed?
๐Ÿ‘9
SELECT
    protocol,
    SUM(traffic_in) AS total_traffic_in,
    SUM(traffic_out) AS total_traffic_out
FROM
    traffic
GROUP BY
    protocol
HAVING
    SUM(traffic_in) > SUM(traffic_out)
ORDER BY
    protocol ASC;

DPI Software Protocols Report โœ…
#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
int m(vector<int>& w) {
    unordered_map<int, int> c;

    for (int x : w) {
        c[x]++;
    }

    int p = 0;

    for (const auto& [l, q] : c) {
        int t = q;
        unordered_map<int, int> u;

        for (const auto& [a, b] : c) {
            if (a < l) {
                int f = l - a;
                if (c.find(f) != c.end() && u[a] < b && u[f] < c[f]) {
                    int r = min(b - u[a], c[f] - u[f]);
                    t += r;
                    u[a] += r;
                    u[f] += r;
                }
            }
        }

        p = max(p, t);
    }

    return p;
}

Turing โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#define ll long 
void dfs(int node,vector<vector<ll>> &g,vector<bool> &vis,vector<ll> &index,vector<ll> &ds,vector<int> &container){
    vis[node]=1;
    index.push_back(node);
    ds.push_back(container[node]);

    for(auto &it: g[node]){
        if(!vis[it]){
            dfs(it,g,vis,index,ds,container);
        }
    }
}
vector<int> ss(vector<int> &container,vector<int> &firstIndex,vector<int> &secondIndex,vector<int> &slides){
    ll n=container.size();
    ll m=firstIndex.size();
    vector<vector<ll>> g(n);
    for(ll i=0;i<m;i++){
        ll l=firstIndex[i]-slides[i];
        l=l+1000000000*n;
        l%=n;
        ll r=secondIndex[i]+slides[i];
        r%=n;
        g[l].push_back(r);
        g[r].push_back(l);
    }
    vector<bool> vis(n);
    vector<int> ans(n);
    for(ll i=0;i<n;i++){
        vector<ll> index;
        vector<ll> ds;
        if(!vis[i]){
            dfs(i,g,vis,index,ds,container);
        }
        if(index.empty())continue;
        sort(index.begin(),index.end());
        sort(ds.begin(),ds.end(),greater<ll>());

        for(ll i=0;i<index.size();i++){
            ans[index[i]]=ds[i];
        }
    }
    return ans;
}


Maximal Permutation โœ…
๐Ÿ‘1
typedef vector<int> vi;
vi solve(vi &nums, int interns, int timeTaken){
int n=nums.size();
vi ans(n);
priority_queue<int, vi, greater<int>>pq;
for(int i=0; i<min(interns, n); i++){
  pq.push(nums[i]+timeTaken);
  ans[i]=nums[i]+timeTaken;
}
if(interns>=n)return ans;
for(int i=interns; i<n; i++){
  ans[i]=max(nums[i], pq.top())+timeTaken;
  pq.pop();
  pq.push(ans[i]);
}
return ans;
}

string canInternsDoTheTask(int tasks, int n1, int n2, int n3, int t, int d){
vi arr(tasks, 0);
vi v1=solve(arr, n1, t);
vi v2=solve(v1, n2, t+2);
vi v3=solve(v2, n3, t-2);
int time=v3[tasks-1];
if(time<=d){
  return "YES "+to_string(time);
}else{
  return "NO "+to_string(time-d);
}
}


Test Creation โœ