๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.52K subscribers
5.56K photos
3 videos
95 files
9.7K 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
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> arr(n);

    for (int i = 0; i < n; ++i)
        cin >> arr[i];

    for (int i = 0; i < n; ++i) {
        auto it = find(arr.begin() + i + 1, arr.end(), arr[i]);
        if (it != arr.end())
            cout << "1 ";
        else
            cout << "-1 ";
    }

    return 0;
}

Walmart โœ…
def func():
    nums = list(map(int, input().split()))
   
    if not nums: return 0
    dp = {}
   
    for num in nums:
        if num / 3 in dp: dp[num] = dp[num / 3] + 1
        else: dp[num] = 1

    return max(dp.values())
   

print(func())

Triple Subsequence โœ…
Walmart
def func():
    n = int(input())
    grid = []
    for i in range(n):
        a, b = map(int, input().split())
        grid.append((a, b))
       
    k = int(input())
    distances = [(x2 + y2, (x, y)) for x, y in grid]
   
    distances.sort()
    res = [point for _, point in distances[:k]]
    for i in range(k):
        print(res[i][0], res[i][1])

func()

Alice playing game โœ…
Walmart
int inv(int a) {
  return a <= 1 ? a : mod - (long long)(mod/a) * inv(mod % a) % mod;
}
int solve(vector<int>nums){
    int n = nums.size();
    vector<int> ans;


    ans.push_back(nums[0]);

    for (int i = 1; i < n; i++) {
        if (nums[i] > ans.back()) {
            ans.push_back(nums[i]);
        }
        else {

           
            int low = lower_bound(ans.begin(), ans.end(),
                                  nums[i])
                      - ans.begin();

           
            ans[low] = nums[i];
        }
    }

   
    return inv(ans.size());
}

Books โœ…
Walmart
def func():
    n, k = map(int, input().split())
    arr = list(map(int, input().split()))
       
    dp = [float('inf')] * (n + 1)
    dp[0] = 0

    q = deque()

    for i in range(1, n + 1):
       
        while q and q[0] < i - k:
            q.popleft()

        while q and arr[q[-1]] <= arr[i - 1]:
            q.pop()
           
        q.append(i - 1)

        for j in range(max(0, i - k), i):
            dp[i] = min(dp[i], dp[j] + arr[q[0]])

    return dp[n]


print(func())

Server system vulnerabilities โœ…
Source : jogi
int solve(ll n){
  
 
  ll i;

 
  ll a = 0;
  ll b = 1;

  for (i = 2; i <= n; i++)
  {
     
      ll c = a+b;
      a=b;
      b=c;
  }

  return (2*b)%mod;
}
Lucky Strings โœ…
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    vector<pair<int,int>>points(n);
    for(int i=0;i<n;i++){
        cin>>points[i].first>>points[i].second;
    }
    int k;
    cin>>k;
    vector<pair<double,int>>store;
    for(int i=0;i<n;i++){
        double dist=pow((pow(points[i].first,2)+pow(points[i].second,2)),0.5);
        store.push_back({dist,i});
    }
    sort(store.begin(),store.end());
    for(int i=0;i<k;i++){
        int index=store[i].second;
        cout<<points[index].first<<" "<<points[index].second<<endl;
    }
    return 0;
}

At Center โœ…
Walmart
#include <bits/stdc++.h> 
using namespace std; 
#define int long long 
 
int n; 
int t[21][10003]; 
 
int solve(vector<int>& rods, int i, int diff) { 
    if (i == n) { 
        if (diff == 0) 
            return 0; 
 
        return LLONG_MIN;   
    } 
 
    if (t[i][diff + 5000] != -1) 
        return t[i][diff + 5000]; 
 
    int ans = 0; 
 
    int nothing = solve(rods, i + 1, diff); 
    int in_rod_1 = rods[i] + solve(rods, i + 1, diff + rods[i]); 
    int not_in_rod1 = rods[i] + solve(rods, i + 1, diff - rods[i]); 
 
    return t[i][diff + 5000] = max({nothing, in_rod_1, not_in_rod1}); 

 
int check(vector<int>& rods) { 
    n = rods.size(); 
 
    memset(t, -1, sizeof(t)); 
 
    return solve(rods, 0, 0) / 2; 

 
signed main() { 
    int n; 
    cin >> n; 
    vector<int> rods(n); 
    for (int i = 0; i < n; ++i) 
        cin >> rods[i]; 
    cout << check(rods); 
 
    return 0; 
}

Maximum power โœ…
def max_difference(arr):
    n = len(arr)
    next_greater = [-1] * n
    stack = []

    for i in range(n):
        while stack and arr[i] > arr[stack[-1]]:
            next_greater[stack.pop()] = i

        stack.append(i)

    max_diff = float('-inf')

    for i in range(n):
        if next_greater[i] != -1:
            max_diff = max(max_diff, abs(arr[next_greater[i]] - arr[i]))

    return max_diff

Calculate Difference โœ…
def is_prime(num):
    if num < 2:
        return False
    for i in range(2, int(num**0.5) + 1):
        if num % i == 0:
            return False
    return True

def max_distance_between_primes(arr):
    primes = [i for i in arr if is_prime(i)]

    if len(primes) < 2:
        return -1

    max_distance = 0
    for i in range(1, len(primes)):
        distance = primes[i] - primes[i - 1]
        max_distance = max(max_distance, distance)

    return max_distance

Maximum prime difference โœ…
#include<bits/stdc++.h>
using namespace std;

string solve(int x1, int y1, int r1, int x2, int y2, int r2) {
    int distSq = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
    int radSumSq = (r1 + r2) * (r1 + r2);
    if (distSq == radSumSq)
        return "Touching";
    else if (distSq == 0) {
        if (r1 == r2)
            return "Concentric";
        else
            return "Disjoint-Inside";
    }
    else if (distSq > radSumSq)
        return "Disjoint-Outside";
    else
        return "Intersecting";
}

vector<string> circles(vector<string> circlePairs) {
    vector<string> result;
    for (const string& pair : circlePairs) {
        stringstream ss(pair);
        int x1, y1, r1, x2, y2, r2;
        ss >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
        result.push_back(solve(x1, y1, r1, x2, y2, r2));
    }
    return result;
}

IBM โœ…
role of "Data Engineer".

Skills: Data Engineering, SQL, Python, Spark, Kafka, Big Data / Cloud DWH
Work mode: Bangalore โ€“ Hybrid / Other locations โ€“ Remote
Interview Rounds: 2 (G-Meet)
Notice Period: Immediate to max 10 days.

If interested, please share your CV to the below email id.

Email: Madhumita.jadhav@nuvento.com
Genpact is hiring for Talent Acquistion - Sourcing Specialist (NON-IT)

Current Location- NCR
Notice Period - Immediate to 15 days
RTO Mandate

Interested candidates can share their resume at mizba.mohammedshaikh@genpact.com with subject line "Application for Talent acquisition role"