๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K 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
๐Ÿ“ŒKGiSL Hiring
Freshers as AWS Trainee (AWS & Linux)

Position Title : AWS Trainee or Consultant

Experience : 0 - 1.5 years

Mandatory skill - AWS, Linux

Location  : Coimbatore

Interested candidates can share your CV to praveen.kowsik@kgisl.com
๐Ÿ“Œ Company: Bluetris Technologies

โœจExciting Opportunity for DevOps freshers in Jaipur!

๐Ÿ”น Position: DevOps Engineer
(0-6 Months Experience)
๐Ÿ”น Location: Jaipur

Key Skills:
- Understanding of DevOps principles and practices
- Experience with tools like Docker,    Kubernetes, Jenkins, and Git
- Knowledge of cloud platforms (AWS, Azure, GCP) is a plus
- Strong problem-solving skills and a proactive attitude

๐Ÿ“ฉ To Apply: Send your resume to Khushi.bumb@bluetris.com
๐Ÿ‘1๐Ÿ‘Ž1
import java.util.*;
public class Main {
    public int[] solution(int[] skills) {
        int N = skills.length;
        int[] results = new int[N];
        List<Integer> e = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            e.add(i);
        }
        int round = 1;
             while (e.size() > 1) {
            List<Integer> r = new ArrayList<>(); 
                for (int i = 0; i < e.size(); i += 2) {
                int player1 = e.get(i);
                int player2 = e.get(i + 1);
                if (skills[player1] > skills[player2]) {
                    results[player2] = round;
                    r.add(player1);
                } else {
                    results[player1] = round;
                    r.add(player2);
                }
            }
            e = r;
            round++;
        }
        results[e.get(0)] = round - 1;
        return results;
    }
๐Ÿ‘1๐Ÿ‘Ž1
def whereIsPrincessPeach(m):
    if not m or not m[0]:
        return 7
    r,c=len(m),len(m[0])
    dp=[[0]*c for _ in range(r)]
    dp[0][0]=m[0][0]
    for i in range(1,c):
        dp[0][i]=dp[0][i-1]+m[0][i]
    for i in range(1,r):
        dp[i][0]=dp[i-1][0]+m[i][0]
    for i in range(1,r):
        for j in range(1,c):
            dp[i][j]=max(dp[i-1][j],dp[i][j-1])+m[i][j]
    return max(7,-dp[r-1][c-1]+1)

def main():
    r,c=map(int,input().split())
    m=[list(map(int,input().split())) for _ in range(r)]
    print(whereIsPrincessPeach(m))

if __name__=="__main__":
    main()
๐Ÿ‘Ž1
def photoAlbum(idx, identity):
    n = len(idx)
    album = []
    for i in range(n):
        album.insert(idx[i], identity[i])
    return album


Photo Album โœ…
Python 3
๐Ÿ‘1๐Ÿ‘Ž1
def solve(n,k,nums):
    mxS=max(0,max(nums))
    cS=0
    for i in range(n):
        cS=max(0,cS+nums[i])
        if i>=k:
            mxS=max(mxS,cS)
    return mxS
๐Ÿ‘Ž2
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
public static int solution(int[] A, int[] B) {
        int MAX_SIDE = 500;
        int[][] frequency = new int[MAX_SIDE + 1][MAX_SIDE + 1];
       
        for(int i = 0; i < A.length; i++) {
            int a = A[i];
            int b = B[i];
            if(a < 1 || a > MAX_SIDE || b < 1 || b > MAX_SIDE) {
                continue;
            }
            frequency[a][b]++;
            if(a != b) {
                frequency[b][a]++;
            }
        }
       
        int maxSubset = 0;
       
        for(int s = 1; s <= MAX_SIDE; s++) {
            for(int t = 1; t <= MAX_SIDE; t++) {
                if(t + 1 > MAX_SIDE) {
                    if(frequency[s][t] > maxSubset) {
                        maxSubset = frequency[s][t];
                    }
                } else {
                    int currentCount = frequency[s][t] + frequency[s][t + 1];
                    if(currentCount > maxSubset) {
                        maxSubset = currentCount;
                    }
                }
            }
        }
       
        return maxSubset;
    }


Bentley โœ…
๐Ÿ‘Ž2
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
// LOTTERY
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
using namespace std;

int dp[1001][1001][26]; // Adjust size as needed based on the problem constraints

int getCharWithDiff(char ch, int diff) {
    int code = ch - 'a';
    return ((code + diff + 26) % 26) + 'a';
}

int dfs(const string &lotteryID, const string &winnerID, int i, int j, int remainingK, int m, int n) {
    if (i == m || j == n) return 0;
    if (remainingK < 0) return 0;
    if (dp[i][j][remainingK] != -1) return dp[i][j][remainingK];

    int result = max(
        dfs(lotteryID, winnerID, i + 1, j, remainingK, m, n),
        dfs(lotteryID, winnerID, i, j + 1, remainingK, m, n)
    );

    if (lotteryID[i] == winnerID[j]) {
        result = max(result, 1 + dfs(lotteryID, winnerID, i + 1, j + 1, remainingK, m, n));
    } else if (remainingK > 0) {
        for (int diff = 1; diff <= min(25, remainingK); ++diff) {
            if (getCharWithDiff(lotteryID[i], diff) == winnerID[j] ||
                getCharWithDiff(lotteryID[i], -diff) == winnerID[j]) {
                result = max(result, 1 + dfs(lotteryID, winnerID, i + 1, j + 1, remainingK - diff, m, n));
                break;
            }
        }
    }

    dp[i][j][remainingK] = result;
    return result;
}

int maxLCSAfterOperations(const string &lotteryID, const string &winnerID, int k) {
    int m = lotteryID.size();
    int n = winnerID.size();
    memset(dp, -1, sizeof(dp));
    return dfs(lotteryID, winnerID, 0, 0, k, m, n);
}
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <string>
using namespace std;
string findStringFromIcp(vector<vector<int>>& icp) {
    int n = icp.size();
        for (int i = 0; i < n; i++) {
        if (icp[i][i] != n - i) {
            return "Impossible";
        }
        for (int j = i + 1; j < n; j++) {
            if (icp[i][j] != icp[j][i]) { 
                return "Impossible";
            }
        }
    }
        string result(n, ' ');
    result[0] = 'a';      
    for (int i = 1; i < n; i++) {
        bool assigned = false;
        for (int j = 0; j < i; j++) {
            if (icp[j][i] > 0) {
                result[i] = result[j];
                assigned = true;
                break;
            }
        }
        if (!assigned) {
            result[i] = result[i - 1] + 1;
            if (result[i] > 'z') {
                return "Impossible"; 
            }
        }
    }
        for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            int commonLength = 0;
            while (i + commonLength < n && j + commonLength < n && result[i + commonLength] == result[j + commonLength]) {
                commonLength++;
            }
            if (commonLength != icp[i][j]) {
                return "Impossible";
            }
        }
    }
   
    return result;
}