๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.6K 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
// rat and chesse
#include<bits/stdc++.h>
using namespace std;
int bfs(vector<vector<int>>&grid){
        queue<pair<int,int>>q;
        int dx[4]={0,0,1,-1};
        int dy[4]={1,-1,0,0};
        for(int i=0;i<grid.size();i++){
            for(int j=0;j<grid[0].size();j++){
                if(grid[i][j]==2)q.push({i,j});
            }
        }
        int time=0;
        while(!q.empty()){
            int k=q.size();
            bool found=false;
            while(k--){
                int r=q.front().first,c=q.front().second;
                q.pop();
                grid[r][c]=2;
                for(int i=0;i<4;i++){
                    int row=r+dx[i],col=c+dy[i];
                    if(row>=0&&row<grid.size()&&col>=0&&col<grid[0].size()&&grid[row][col]==1){
                        q.push({row,col});found=true;
                        grid[row][col]=2;
                    }
                }
            }
            if(found)
             time++;
        }
        // check -1
        for(int i=0;i<grid.size();i++){
            for(int j=0;j<grid[0].size();j++){
                if(grid[i][j]==1)return -1;
            }
        }
        return time;
    }
int main(){
    vector<vector<int>>v={{2,1,1},{1,1,0},{0,1,1}};
    cout<<bfs(v);
}
Get the Max productโœ…

#include<bits/stdc++.h>
using namespace std;
int length(string s){
    bool found=false;
    int temp=0;
    for(int i=0;i<s.size();i++){
        if(isdigit(s[i])){
            found=true;
            temp*=10;
            temp+=(s[i]-'0');
        }
    }
    if(found==false){
        return s.size();
    }
    return temp;
}
long long  solve(vector<string>v,int n){
    vector<int>len;
    for(int i=0;i<n;i++){
        len.push_back(length(v[i]));
    }
    int max1=0,max2=0;
    for(int i=0;i<n;i++){
        if(len[i]>max1){
             max2=max1;
            max1=len[i];
        }
        else if(len[i]>max2){
            max2=len[i];
        }
    }
    return max1*max2*1ll;
    return len[n-1]*len[n-2]*1ll;
}
int main(){
    int n;cin>>n;
    vector<string>v(n,"");
    for(int i=0;i<n;i++)
    {
        cin>>v[i];
    }
    cout<<solve(v,n);
}
#include <bits/stdc++.h>
using namespace std;
   
int main() {
 
  int n;
  cin>>n;
  vector<int> v(100005);
  for(int i = 0; i < n; i++) cin>>v[i];
  int ans = 0;
  int i = n-1;
  while(i >= 0) {
    if(v[i] >= 0) {
      ans += v[i]; i--; continue;
    }
    else {
      v[i] *= -1;
      int y = v[i], x = 0;
      ans += v[i]; i--;
      while(i >= 0 && v[i] >= 0) {
        x += v[i];
        i--;
        if(x >= y) break;
      }
    }
  }
  cout<<ans;

    return 0;
}

Good Sum โœ…
int MinimumCost(int n, int m, vector<vector<int>>& grid) {
    vector<int> ele;

    vector<vector<int>> grid_inv(m, vector<int>(n));

    for (int j = 0; j < m; j += 1) {
        for (int i = 0; i < n; i += 1) {
            grid_inv[j][i] = grid[i][j];
        }
    }

    for (int j = 0; j < m; j += 1) {
        sort(grid_inv[j].begin(), grid_inv[j].end());
    }

    for (int i = 0; i < n; i += 1) {
        for (int j = 0; j < m; j += 1) {
            ele.push_back(grid[i][j]);
        }
    }

    sort(ele.begin(), ele.end());

    int sz = ele.size();

    int ans = 1e9; // Assuming int limit is sufficient for ans

    for (int i = 0; i < ele.size(); i += 1) {
        int mx = ele[i];
        bool f = 1;
        int mn = 1e9; // Assuming int limit is sufficient for mn
        for (int j = 0; j < m; j += 1) {
           int idx = lower_bound(grid_inv[j].begin(), grid_inv[j].end(), mx) - grid_inv[j].begin();
           if (idx >= n || grid_inv[j][idx] > mx) idx--;
           if (idx < 0) {
            f = 0;
            break;
           }
           mn = min(mn, grid_inv[j][idx]);
        }

        if (f) ans = min(ans, mx - mn);
    }

    return ans;
}

Minimum Cost pathโœ…
int solve(string S) {
    set<int> decimalValues;
    int n = S.length();
   
    for (int i = 1; i < (1 << n); i++) {
        int subsequenceDecimal = 0;
        for (int j = 0; j < n; j++) {
            if (i & (1 << j)) {
                subsequenceDecimal = subsequenceDecimal * 2 + (S[j] - '0');
            }
        }
        decimalValues.insert(subsequenceDecimal);
    }
   
    int distinctDecimalValues = decimalValues.size();
    int moduloResult = distinctDecimalValues % (int)(1e9 + 7);
    return moduloResult;
}

Distinct Subsequenceโœ…
int countKSubsequencesWithMaxBeauty(string s, int k) {
    vector<int> count(26);
    for (char& c : s)
        count[c - 'a']++;
    
    nth_element(count.begin(), count.begin() + 26 - k, count.end());
    
    if (k > 26 || count[26 - k] == 0)
        return 0;
    
    long long res = 1, comb = 1, bar = count[26 - k], mod = 1e9 + 7, pend = 0;
    
    for (int& freq : count) {
        if (freq > bar) {
            k--;
            res = res * freq % mod;
        }
        if (freq == bar)
            pend++;
    }
    
    for (int i = 0; i < k; ++i) {
        comb = comb * (pend - i) / (i + 1);
        res = res * bar % mod;
    }
    
    return res * comb % mod;
}

GOOGLE SPECIAL-SUBSEQUENCE CODE
๐Ÿ‘1๐Ÿคฎ1
Sutherland Walk-In Interview

1st October โ€“ 6th October , 9.30 AM โ€“ 5.30 PM

How to Apply:

Interested candidates are invited to attend a walk-in interview. Please mention โ€œHR Priyaโ€ at the top of your resume. Donโ€™t forget to bring your resume, a photocopy of your Aadhar card, and your COVID-19 vaccination certificate (2/3 doses).

Walk-in Details:

Date: October 1st โ€“ October 6th
Time: 9:30 AM โ€“ 5:30 PM
Location: Survey No. 201, Lanco Hills Technology Park, Lanco Hills, Sai Vaibhav Layout, Manikonda, Hyderabad, 500089, India.

Contact Information: For inquiries, contact Priya at 9032420290.
Dear Recruiter,

I hope this message finds you well. I am reaching out to inquire about any suitable job openings that match my qualifications and experience in Software development Engineer .

I would greatly appreciate it if you could keep me informed of any job openings that would be a good match for my profile.

Thank you for considering my request, and I look forward to hearing back from you soon, Please Share this with your Hiring network, It will be a great help for me.

Best regards,
Xyz

Template for connect with Recruiter #veryhelpful