๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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
NimbusPost is hiring Freshers!!

We are looking for passionate people with strategic mindset and business acumen for Management Trainee Role.

ROLE: Management Trainee (Business Strategy & Analysis)
LOCATION: Gurgaon (Work from Office)
EDUCATIONAL QUALIFICATION: MBA or equivalent degree (Specialisation in Business Strategy, General Management , Marketing & Strategy are preferred)

Interested students can share their CVs at manvi.g@nimbuspost.com .
#define ll long long
#include<bits/stdc++.h>
using namespace std;

ll solve(ll N, ll K, vector<ll>& A, vector<ll>& B ) {
    vector<ll> dp(K + 1, 0);
    for (ll i = 0; i < N; ++i) {
        for (ll j = K; j >= A[i]; --j) {
            dp[j] = max(dp[j], B[i] + dp[j - A[i]]);
        }
    }
    return dp[K];
}

int main() {
    ll N, K;
    cin >> N >> K;
    vector<ll> A(N), B(N);
    for (ll i = 0; i < N; ++i) {
        cin >> A[i];
    }
    for (ll i = 0; i < N; ++i) {
        cin >> B[i];
    }
    cout << solve(N, K, A, B ) << endl;
    return 0;
}
#include <iostream>
#include <vector>
#include <climits>

using namespace std;

class Solution {
public:
    //total water is trapped into the bars
    int trap(vector<int>& h) {
        int l = 0, r = h.size() - 1, lmax = INT_MIN, rmax = INT_MIN, ans = 0;
        while (l < r) {
            lmax = max(lmax, h[l]);
            rmax = max(rmax, h[r]);
            ans += (lmax < rmax) ? lmax - h[l++] : rmax - h[r--];
        }
        return ans;
    }
};

int main() {
    Solution solution;
   
    int N;
   
    cin >> N;

    vector<int> heights(N);
    cout << N;
    for (int i = 0; i < N; ++i) {
        cin >> heights[i];
    }

    int trappedWater = solution.trap(heights);
    cout  << trappedWater << endl;

    return 0;
}

Trapping Rain water โœ…
import java.util.*;

class Main {
  public static void main (String[] args) {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt(),i,j;
    long low[]=new long[n]; long high[]=new long[n];
    long ans=1L,mod=(long)1e9+7;
    for(i=0;i<n;i++) low[i]=sc.nextLong();
    for(i=0;i<n;i++) high[i]=sc.nextLong();
    boolean prime[]=new boolean[(int)1e6+1];
    prime[1]=true;
    for(i=2;i<=(int)1e6;i++)
    {
        if(prime[i]) continue;
        for(j=2*i;j<=(int)1e6;j+=i) prime[j]=true;
    }
    for(i=0;i<n;i++){
        long val=0;
        for(long k=low[i];k<=high[i];k++) if(!prime[(int)k]) val=val+k;
        ans=(ans*val)%mod;
    }
    System.out.println(ans);
  }
}

Infosys โœ…
Forwarded from Amazon Exam Placement Group (Dushyant)
int solution(const string &s) {
    const int n = s.length();
    int r = 0;
    for (int i = n - 1, j = 0; i >= 0 && j < n; ++j) {
        if (s[i] == s[j]) {
            --i;
            ++r;
        }
    }
    return n - r;
}


Amazon โœ…
Entry level position ( #Fresher )

Company: Cognizant

Requirement: Must have Bachelor's degree, strong communication and interpersonal skills.

#Interested candidates can send their resume to varsha.jha5@cognizant.com

Note: Please include "Entry-level position Application" in the subject line.
๐Ÿ‘1
CelebAI Technologies are hiring for Associate Software Engineer Position(Trainee+ FTE).

Walk in drive in the office for 2023, 2024 batch.
Please share your CV at
careers@celeb-ai.com.

Eligibility: Only Delhi NCR students or who can come to Delhi and haven't attended drive from last 6 months should apply.
[Please increase the reach for visibility]
๐Ÿ‘1
#include<stdio.h>
#include<stdlib.h>

#define MOD 1000000007

int compare(const void *a, const void *b) {
    return (*(int*)a - *(int*)b);
}

int main() {
    int N;
    scanf("%d", &N);

    if (N <= 1) {
        printf("NO HOURS\n");
        return 0;
    }

    int *A = (int*)malloc(N * sizeof(int));

    for (int i = 0; i < N; i++) {
        scanf("%d", &A[i]);
    }

    qsort(A, N, sizeof(int), compare);

    int count = 0;

    for (int i = 0; i < N - 1; i++) {
        for (int j = i + 1; j < N; j++) {
            if ((A[i] + A[j]) % 60 == 0) {
                count = (count + 1) % MOD;
            }
        }
    }

    if (count > 0) {
        printf("%d\n", count);
    } else {
        printf("NO HOURS\n");
    }

    free(A);

    return 0;
}

Hours Count โœ…
NPCI
๐Ÿ‘1