๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.55K subscribers
5.57K photos
3 videos
95 files
9.8K 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 <bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
int32_t main(){
    ll n,m;
    cin>>n>>m;
    vector<ll> a(n);
    vector<ll> b(m);
    vector<ll> pre(n+1);
    for(int i=0;i<n;i++){
        cin>>a[i];
        pre[i+1]=pre[i]+a[i];
    }
    for(int i=0;i<m;i++){
        cin>>b[i];
    }
    ll k=(1LL<<m)-1;
    ll dp[n+1][k+1];
    for(int i=0;i<=n;i++){
        for(int j=0;j<=k;j++){
            dp[i][j]=0;
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=0;j<=k;j++){
            dp[i][j]=max(dp[i][j],dp[i-1][j]);
            for(int l=0;l<m;l++){
                if((1LL<<l)&j){
               
                }
                else{
                    ll next=(1LL<<l)|j,idx=i+b[l]-1;
                    if(idx>=0 and idx<=n)
                    dp[idx][next]=max(dp[idx][next],dp[i-1][j]+pre[idx]-pre[i-1]);
                }
            }
        }
    }
    ll ans=0;
    for(int i=0;i<=n;i++){
        ans=max(dp[i][k],ans);
    }
    cout<<ans<<endl;
    return 0;
}


Seat Bookingโœ…
๐Ÿ‘1
#include <bits/stdc++.h>
using ll = long long ;
using namespace std;
ll calculateResult(vector<ll>& arr, ll n, ll k) {
    set<int> st;
    ll ans = 0;
    ll sum = 0;
    sort(arr.begin(), arr.end(), greater<int>());
    for (ll i = 0; i < n; i++) {
        if (st.find(arr[i]) != st.end()) {
            continue;
        }
        if (arr[i] - sum > 0) {
            sum += k; 
            ans++;   
            st.insert(arr[i]); 
        }
    }
    return ans;
}


Go Daddy โœ…
๐Ÿ‘2
#include <iostream>
#include <vector>
using namespace std;
vector<int> solve(const vector<int>& arr) {
    int n = arr.size();
    vector<int> result;
        for (int i = 0; i < n - 2; i++) {
        int a = arr[i];
        int b = arr[i + 1];
        int c = arr[i + 2];
                if (a + b > c && a + c > b && b + c > a) {
            result.push_back(1);
        } else {
            result.push_back(0);
        }
    }
   
    return result;
}


Motive (SWE) โœ…
#include <iostream>
#include <vector>
int solve(vector<int>& visits, int target) {
    int n = visits.size();
    for (int i = 0; i < n; ++i) {
        int sum = 0;
        for (int j = 0; j <= i; ++j) {
            sum += visits[j];
        }
        if (sum >= target) {
            return i;
        }
    }
   
    return -1;
}

Databricks โœ…
๐Ÿคฎ1
#include <bits/stdc++.h>
using ll = long long ;
using namespace std;
bool isPalindrome(int number) {
    string str =to_string(number);
    int left = 0, right = str.size() - 1;
    while (left < right) {
        if (str[left] != str[right]) {
            return false;
        }
        left++;
        right--;
    }
    return true;
}
vector<int> findPalindromicTransactions(vector<int>& transactions) {
    std::vector<int> palindromicIDs;
    for (int transaction : transactions) {
        if (isPalindrome(transaction)) {
            palindromicIDs.push_back(transaction);
        }
    }

    sort(palindromicIDs.begin(), palindromicIDs.end(),greater<int>());

    return palindromicIDs;
}


Databricks โœ…
๐Ÿ˜ข1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

long maximize(int x_rows, int x_columns, vector<vector<int>>& x) {
    vector<vector<long>> prefixSum(x_rows + 1, vector<long>(x_columns + 1, 0));
    for (int i = 1; i <= x_rows; ++i) {
        for (int j = 1; j <= x_columns; ++j) {
            prefixSum[i][j] = x[i-1][j-1] +
                               prefixSum[i-1][j] +
                               prefixSum[i][j-1] -
                               prefixSum[i-1][j-1];
        }
    }

    long maxF = 0;

    for (int h = 1; h < x_rows; ++h) {
        for (int v = 1; v < x_columns; ++v) {
            long sumA = prefixSum[h][v];
            long sumB = prefixSum[h][x_columns] - prefixSum[h][v];
            long sumC = prefixSum[x_rows][v] - prefixSum[h][v];
            long sumD = prefixSum[x_rows][x_columns] - prefixSum[h][x_columns] - prefixSum[x_rows][v] + prefixSum[h][v]; // Bottom-right
            long fX = abs(sumA) + abs(sumB) + abs(sumC) + abs(sumD);
            maxF = max(maxF, fX);
        }
    }

    return maxF;
}
Blinkit Analyst Intern

Looking for a talented individual to join as an Analyst Intern in the Central Ops strategy team at Blinkit in Gurgaon.

Key Skills:

- Proficiency in Basic SQL and Excel (including Dashboarding and VBA).

Strong problem-solving abilities and logical thinking.

- Final-year students or fresh graduates preferred, but open to others.

Additional information:

- Internship Duration: 3 months

- PPO based on performance

Join us ASAP (preferably within 7-15 days) by filling out the form below. Applications

open till 27th Oct'24.


https://docs.google.com/forms/d/e/1FAIpQLSe604ZBbM5HqQmuPo7vHT4guszf0TNsakzILpE3ZMHhOH6iTQ/viewform
def ss(firstnum: str, secondnum: str, thirdnum: str) -> bool:
    target_sum = int(thirdnum)
    second_value = int(secondnum)
    if int(firstnum) + second_value == target_sum:
        return True
    for i in range(len(firstnum)):
        new_firstnum = firstnum[:i] + firstnum[i+1:]
        if new_firstnum and (new_firstnum[0] != '0'):
            if int(new_firstnum) + second_value == target_sum:
                return True
    return False