๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.62K 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,vector<int>diff,int lb,int up){
    int x=diff[0],x1=INT_MIN,y=diff[0],y1=INT_MAX;
    for(int i=1;i<n;i++){
        x+=diff[i];
        y +=diff[i];
        x1=max(x1,x);
        y1=min(y1,y);
    }
    int ans=0;
    for(int h=lb;h<=up;h++)
    {
        if(h+y1>=lb && h+x1<=up)
           ans++;
          
    }
    return ans;
   
}

Lower bound upper bound โœ…
Atlassian
๐Ÿ‘1
#include <bits/stdc++.h>
using namespace std;

const int MOD = 1e9 + 7;


long long power(long long x,
    long long y,
    const int& MOD)
{
long long res = 1;
while (y > 0) {
  if (y & 1)
   res = (res * x) % MOD;
  x = (x * x) % MOD;
  y /= 2;
}
return res;
}


long long countGraphs(int n)
{

 
long long x = n * (n - 1) / 2;

 
return power(2, x, MOD);
}


int main()
{
int n;

cout << countGraphs(n);

return 0;
}

Vertices โœ…
int minTime(std::vector<int> processorTime, std::vector<int> taskTime) {
    std::sort(processorTime.begin(), processorTime.end());
    std::sort(taskTime.begin(), taskTime.end(), std::greater<int>());
   
    int maxTime = 0;
   
    for(int i = 0; i < processorTime.size(); i++){
        processorTime[i] += taskTime[i*4];
        maxTime = std::max(maxTime, processorTime[i]);
    }
   
    return maxTime;
}

Minimum Process Timing

Ceilego ( C++โœ…)
Please find latest Opportunities from Career page and Apply before Expired before applying kindly follow jobs description and eligibility carefully

passout year: 2023, 2022, 2021, 2020, 2019, 2018

Join us


Moody Hiring Associate Software Engineer
Salary: 12lpa - 14lpa
Apply now: https://careers.moodys.com/job/18815826/associate-software-engineer-bangalore-in/

IDFC First bank Hiring Data Scientist
Salary: 14 lpa ( Expected)
Apply now: https://ekjx.fa.em2.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/requisitions/preview/105955

Zoha Hiring Software Developer
Salary: 8lpa - 10lpa
Apply now; https://www.zoho.com/careers/jobdetails/?job_id=2803000614929615

Elevates Hiring Associate QA
Apply now : https://careers3-elevateservices.icims.com/jobs/2632/associate-qa/job

NTT Hiring Graduate Engineer trainee
Apply now: https://careers.services.global.ntt/global/en/job/NTT1GLOBALR101060EXTERNALENGLOBAL/Graduate-Trainee-Engineer

Airtel Hiring Data Analyst
Apply now: https://eeji.fa.em3.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/job/117879/

Baker Hughes Hiring Trainee
Salary: 3.5 lpa - 4.5 lpa
Apply now: https://careers.bakerhughes.com/global/en/job/BAHUGLOBALR90963/Early-Career-Trainee

Oracle Hiring Software Developer
Salary: 14 lpa ( Expected)
Apply now: https://eeho.fa.us2.oraclecloud.com/hcmUI/CandidateExperience/en/sites/jobsearch/requisitions/preview/204012/?keyword=Software+Developer
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include<bits/stdc++.h>
using namespace std;

struct Node {
   int data;
   struct Node* left;
   struct Node* right;
};

struct Node* newNode(int data) {
   struct Node* node = new Node;
   node->data = data;
   node->left = NULL;
   node->right = NULL;
   return(node);
}

void convertTreeToItsMirror(struct Node* node) {
   if (node == NULL) {
      return;
   } else {
      struct Node* temp;
      convertTreeToItsMirror(node->left);
      convertTreeToItsMirror(node->right);
      temp = node->left;
      node->left = node->right;
      node->right = temp;
   }
}

void printTree(struct Node* node) {
   if (node == NULL) {
      return;
   }
   printTree(node->left);
   cout << node->data << " ";
   printTree(node->right);
}

int main() {
   struct Node *root = newNode(1);
   root->left = newNode(2);
   root->right = newNode(3);
   root->left->left = newNode(4);
   root->left->right = newNode(5);

   cout << "Tree: ";
   printTree(root);
   cout << endl;

   convertTreeToItsMirror(root);

   cout << "Mirror of the Tree: ";
   printTree(root);
   cout << endl;

   return 0;
}

Generate mirror of Binary Tree C++โœ…
vector<long long> solve(vector<int> &A, vector<vector<int>> &B) {
    int n = A.size();
    vector<long long> result;

    for (auto &query : B) {
        int rdx= query[0];
        int l = query[1] - 1; 
        int r = query[2] - 1; 
        int v = query[3];

        if (rdx == 1) {
            for (int i = l; i <= r; ++i) {
                A[i] = v;
            }
        } else if (rdx == 2) {
            for (int i = l; i <= r; ++i) {
                A[i] |= v;
            }
        } else if (rdx == 3) {
            long long ans = 0;
            for (int len = 1; len <= r - l + 1; ++len) {
                for (int i = l; i + len <= r + 1; ++i) {
                    long long subarray_and = A[i];
                    for (int j = i + 1; j < i + len; ++j) {
                        subarray_and &= A[j];
                    }
                    ans += subarray_and;
                }
            }
            result.push_back(ans);
        }
    }
    return result;
}

1st
Trilogy โœ…
int inf = 2e9;
vector<int> solution(int a, vector<vector<int>>& B) {
    int m = B.size();
    vector<int> ans(a + 1, -1);
    vector<int> done(m);
    for (auto x : B) ans[x[1]] = m + 1;
    for (int i = 1; i <= a; i++) {
        if (ans[i] == m + 1) continue;
        int curr = inf, taken = -1;
        for (int j = 0; j < m; j++) {
            int start = i;
            int days = 0, comp = -1;
            int l = 0;
            while (start < a + 1) {
                if (ans[start] == m + 1) {
                    start++;
                    continue;
                }
                days++, start++;
                if (days == B[j][2]) {
                    l = 1;
                    comp = start - 1;
                    break;
                }
            }
            if (!done[j] and B[j][0] <= i and comp < B[j][1] and l) {
                if (B[j][1] < curr) {
                    curr = B[j][1], taken = j;
                }
            }
        }
        if (taken == -1) {
            ans[i] = 0;
            continue;
        }
        B[taken][2]--;
        ans[i] = taken + 1;
        if (!B[taken][2]) done[taken] = 1;
    }
    int d = 0;
    for (auto x : done)
        if (!x) d = 1;
    if (d) {
        vector<int> ret(1, -1);
        return ret;
    } else
        return ans;
}


2nd
Trilogy โœ