๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.61K 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
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cassert>
using namespace std;

// Write your Student class here
class Student{
    private:int scores[5];
    public:int sum=0;
    public:
       void input()
        {
            for(int i=0;i<5;i++)
            {
                cin >> scores[i];
                sum+=scores[i];
            }
        }
        int calculateTotalScore(){
            return sum;
        }

};

int main() {
    int n; // number of students
    cin >> n;
    Student *s = new Student[n]; // an array of n students
   
    for(int i = 0; i < n; i++){
        s[i].input();
    }

    // calculate kristen's score
    int kristen_score = s[0].calculateTotalScore();

    // determine how many students scored higher than kristen
    int count = 0;
    for(int i = 1; i < n; i++){
        int total = s[i].calculateTotalScore();
        if(total > kristen_score){
            count++;
        }
    }

    // print result
    cout << count;
   
    return 0;
}
SELECT e.emp_name
FROM employee e
JOIN cooking c ON e.emp_id = c.emp_id
JOIN recipe r ON c.f_id = r.f_id
GROUP BY e.emp_id, e.emp_name
ORDER BY COUNT(DISTINCT r.ing_id) DESC
LIMIT 3;

Master chefโœ…
โ—๏ธ Accenture Mega Off Campus Drive Hiring 2022/2023 Batch | 4.61 LPA โ—๏ธ

๐Ÿ‘จโ€๐Ÿ’ปJob Role : Application Development Associate
๐ŸŽ“Qualification : B.E/B.Tech/M.E/M.Tech, MCA, M.Sc
๐ŸŽ–Batch : 2022,2023
๐Ÿ’ฐSalary : INR 4.61 LPA

โญ•๏ธ Apply Fast :
https://csalgo.us/2023/12/04/accenture-off-campus-drive-2023-2022-2023-batch-across-india-4-61-lpa/
int isGoodString(string s) {
    int vowels = 0, consonants = 0;
    for (char c : s) {
        if (isalpha(c)) {
            if (c == 'a'
c == 'e' c == 'i' c == 'o' c == 'u') {
                vowels++;
            } else {
                consonants++;
            }
        }
    }
    return vowels > consonants ? 1 : 0;
}

int sumOfDigits(string s) {
    int sum = 0;
    for (char c : s) {
        if (isdigit(c)) {
            sum += c - '0';
        }
    }
    return sum;
}


C: Play with string โœ…
๐Ÿ‘1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
int minimumEnergy(vector<string> river, int initial_x, int initial_y, int final_x, int final_y) {
    int ans=-1;
    // int answer=INT_MAX;
    int n=river.size();
    int m=river[0].size();
    int dr[4]={0,0,1,-1};
    int dc[4]={1,-1,0,0};
    vector<vector<bool>> visited(n, vector<bool>(m, false));
    queue<pair<pair<int,int>,int>> q;
    q.push({{initial_x, initial_y},0});
    visited[initial_x][initial_y]=true;
    while(!q.empty()){
        int size=q.size();
        for(int i=0;i<size;i++){   
            auto temp=q.front();
            int x=temp.first.first;
            int y=temp.first.second;
            int energy=temp.second;
            q.pop();
            if(x==final_x and y==final_y){
                return energy;
            }
            for(int j=0;j<4;j++){
                int nx=x+dr[j];
                int ny=y+dc[j];
                if(nx>=0 and nx<n and ny>=0 and ny<m and visited[nx][ny]==0 and river[nx][ny]=='.'){
                    if(j%2==1){
                        visited[nx][ny]=1;
                        q.push({{nx,ny}, energy+1});
                    }
                    else{
                        visited[nx][ny]=1;
                        q.push({{nx,ny}, energy});
                    }
                }
            }
        }
       
    }
    return -1;
}

Swimming โœ…
๐Ÿ‘1
def solve(arr):
    n = len(arr)
    i = 0
   
    while i + 1 < n and arr[i] < arr[i + 1]:
        i += 1
    while i + 1 < n and arr[i] == arr[i + 1]:
        i += 1
    while i + 1 < n and arr[i] > arr[i + 1]:
        i += 1

    if i == n - 1:
        print("YES")
    else:
        print("NO")

Python 3โœ…
Equivalent Array