๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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
long long cal(vector<int>&arr, long long val)
{
  long long n = arr.size();
  vector<long long>diff;
  for (auto it : arr) {
    long long dif = val - it;
    if (dif != 0) {
      diff.push_back(dif);
    }
  }
  long long cnttwo = 0;
  for (long long i = 0; i < diff.size(); ++i)
  {
    cnttwo += (diff[i] / 2);
    diff[i] %= 2;
  }

  long long cntone = 0;
  for (long long i = 0; i < diff.size(); ++i)
  {
    cntone += diff[i];
  }
  long long res = max(cntone * 2 - 1, cnttwo * 2);
  while (cnttwo > 0 && cntone  < cnttwo ) {
    cnttwo -= 1;
    cntone += 2;
    res = min(res, max(cntone * 2 - 1, cnttwo * 2));
  }
  res = min(res, max(cntone * 2 - 1, cnttwo * 2));
  return res;
}

long long findMinGeneration(vector<int>layer)
{
  long long n = layer.size();
  long long mx = *max_element(layer.begin(), layer.end());

  long long val1 = cal(layer, mx);
  long long val2 = cal(layer, mx + 1);
  long long val3 = cal(layer, mx + 2);
  long long res = min({val1, val2, val3});
  return res;
}
FINDGENERATIONS UBS 13/15 :)
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const int M=998244353;
ll modx(ll x){
return ((x%M + M)%M);
}
ll add(ll a, ll b){
return modx(modx(a)+modx(b));
}
ll mul(ll a, ll b){
return modx(modx(a)*modx(b));
}

ll modPow(ll a, ll b){
    if(b==0)
    return 1LL;
    if(b==1)
    return a%M;
    ll res=1;
    while(b){
        if(b%2==1)
         res=mul(res,a);
         a=mul(a,a);
         b=b/2;
        }
    return res;
}
int main()
{

int n;
cin>>n;
vector<int>v(n);
map<ll,ll>mpp;
map<ll,ll>freq;
for(int i = 0;i<n;i++){
    cin>>v[i];
    freq[v[i]]++;
}

ll m = 1;
ll a = 0;
for(int i = 0;i<=n;i++){
   
    a = add(a,freq[0]);
    ll y = modPow(2,n-a);
    ll mex = mul(m,y);
    mpp[i] = mex;
    m = mul(m,(modPow(2,freq[i])-1));
}
  
int l,r;
cin>>l>>r;

if(l>n){
    cout<<0<<endl;
    return 0;
}
else if(r>n){
   r = n;
}

int s = 0;
for(int i = l;i<=r;i++) s+=mpp[i];
cout<<s<<endl;
return 0;
}


countsubsequences 
UBS โœ…
def conversionPermutation(n):
    if n == 0:
        return "0"

    min_rep = None
    digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"

    for b in range(2, min(n + 1, 37)):
        rep = ""
        temp = n
        while temp > 0:
            rep = digits[temp % b] + rep
            temp //= b
       
        if min_rep is None or rep < min_rep:
            min_rep = rep

    return min_rep


Conversion Permutation โœ…
๐Ÿ‘1
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;

    vector<int> array(N);
    long long sum = 0;

    for (int i = 0; i < N; ++i) {
        std::cin >> array[i];
        sum += array[i];
    }
    if (sum % N == 0) {
       cout << "Yes\n";
    } else {
        int remainder = sum % N;
        cout << "No " << remainder << '\n';
    }

    return 0;
}


Wabtec โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;

ll cost(ll r, ll c, ll j) {
    return pow(r, 2) + j * c;
}

int main() {
    ll l, c, n;
    cin >> l >> c >> n;

    vll v(n);
    for (ll i = 0; i < n; ++i) {
        cin >> v[i];
    }

    v.push_back(0);
    v.push_back(l);

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

    ll mini = LLONG_MAX;
    ll best_jumps = 0;
    ll best_range = 0;

    for (ll i = 1; i < v.size(); ++i) {
        ll r = v[i] - v[i - 1];

        ll last_pos = 0;
        ll j = 0;
        bool f = true;

        for (ll k = 1; k < v.size(); ++k) {
            if (v[k] - last_pos > r) {
                last_pos = v[k - 1];
                j++;
                if (v[k] - last_pos > r) {
                    f = false;
                    break;
                }
            }
        }

        if (f) {
            j++;

            ll total = cost(r, c, j);

            if (total < mini) {
                mini = total;
                best_jumps = j;
                best_range = r;
            }
        }
    }

    cout << mini << " " << best_jumps << " " << best_range << endl;

    return 0;
}


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

using namespace std;

int getMaximumPower(vector<int> arr, vector<int> power) {
    const long MOD = 1e9 + 7;
    int n = arr.size();
    int k = power.size();
   
    vector<long long> prefix_sum(n + 1, 0);
    for (int i = 1; i <= n; ++i) {
        prefix_sum[i] = (prefix_sum[i - 1] + arr[i - 1]) % MOD;
    }
   
    sort(power.begin(), power.end());
   
    long long ans = 0;
    int i = 0;
    int j = k - 1;
   
    while (i < j) {
        if (power[i] == 0) {
            ans = (ans + prefix_sum[power[j] + 1]) % MOD;
        } else {
            ans = (ans + (prefix_sum[power[j] + 1] - prefix_sum[power[i]]) % MOD + MOD) % MOD;
        }
        i++;
        j--;
    }
   
    return ans;
}

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


vector<vector<int>> computePrefixSum(const vector<vector<int>>& a) {
    int n = a.size();
    int m = a[0].size();
    vector<vector<int>> prefix(n, vector<int>(m, 0));

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            prefix[i][j] = a[i][j];
            if (i > 0) prefix[i][j] += prefix[i-1][j];
            if (j > 0) prefix[i][j] += prefix[i][j-1];
            if (i > 0 && j > 0) prefix[i][j] -= prefix[i-1][j-1];
        }
    }

    return prefix;
}


vector<vector<int>> findMatrix(const vector<vector<int>>& a) {
    vector<vector<int>> prefix = computePrefixSum(a);
    int n = a.size();
    int m = a[0].size();
    vector<vector<int>> b(n, vector<int>(m, 0));

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            b[i][j] = prefix[i][j];
        }
    }

    return b;
}


Meesho โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
int getMinMachines(vector<int> start,vector<int> end){
    int n = start.size();
    sort(start.begin(),start.end());
    sort(end.begin(),end.end());
    int i = 0 , j = 0;
    int maxi = 0;
    int curr = 0;
    while(i < n && j < n){
        if(start[i] <= end[j]) i++ , curr++;
        else j++ , curr--;
        maxi = max(curr,maxi);
    }
    return maxi;
}

Expedia โœ…
๐Ÿ‘1
Ocrolus East Hiring Data Verifier โค๏ธโค๏ธโค๏ธ

Job Role: Data Verifier

Qualifications: Any Graduate

Experience: 0-5 years

Job Type: Full Time

Location: Noida

Salary: 3 to 5 LPA

Skills/Requirements:
1. Review Documents of different formats and quality
2. Correct or Edit any incorrect details captured by the Ocrolus proprietary systems
3. Perform reconciliation of various amounts captured from reviewed documents to ensure high accuracy and identify discrepancies
4. Basic Understanding of financial documents and Terminologies.
5. Understanding basic accounting concepts would be an added advantage.

Date of offline Interview: 20th August, 2024

Time : 11.00 AM โ€“ 2.00 PM

Address: Ocrolus East Private Limited, A-61, 2nd Floor, ASF Building, Sector 63, Noida- 201301