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

vector<int>f(vector<int>&r,vector<int>&b,int cost){
    int n=r.size();
    int temp=0;
    vector<int>ans;
    ans.push_back(temp);
    bool flag=true;
    for(int i=0;i<n;i++){
        if(flag){
            if(r[i]<b[i]+cost){
                temp+=r[i];
            }
            else{
                temp+=b[i]+cost;
                flag=false;
            }
        }
        else{
            if(r[i]<b[i]){
                temp+=r[i];
                flag=true;
            }
            else{
                temp+=b[i];
            }
        }
        ans.push_back(temp);
    }
    return ans;
}
int main() {
  int n;
  cin>>n;
  vector<int>r(n),b(n);
  for(int i=0;i<n;i++){
      cin>>r[i];
  }
  for(int i=0;i<n;i++){
      cin>>b[i];
  }
  int cost;
  cin>>cost;
  vector<int>ans=f(r,b,cost);
  for(auto i:ans)cout<<i<<" ";
  return 0;
}

Red Blue
Oracle โœ…
๐Ÿš€ Join Our Team as an HR Business Partner at Amazon Operations! ๐Ÿš€

Are you a strategic HR leader ready to influence and drive organizational effectiveness in a dynamic, 24/7 environment? We're seeking a seasoned HRBP with a passion for shaping HR strategies that align with business goals and foster a high-engagement culture.

Key Responsibilities:

Lead and inspire a team of HR professionals in a high-growth environment.

Design and implement policies that drive continual improvement in business objectives.

Partner with leadership to integrate Amazonโ€™s Leadership Principles into our talent system.

Operate with autonomy to solve problems and craft integrated solutions across the employee lifecycle.

If you're ready to take on a challenging and rewarding role, please send your resume to nesinha@amazon.com. Let's shape the future together!
#include <bits/stdc++.h>
using namespace std;
int xorSubsequence(int a[], int n, int k)
{
    int ans = 0;
    map<int, int> map;

    int dp[n] = { 0 };

    map[a[0]] = 1;
    dp[0] = 1;

    for (int i = 1; i < n; i++) {
        dp[i] = max(dp[i], map[a[i] ^ k] + 1);
        ans = max(ans, dp[i]);
   
        map[a[i]] = max(map[a[i]], dp[i]);
    }

    return ans >= 2 ? ans : 0;
}


IONโœ…
def getString(input_str):
    stack = []
    last_occurrence = {c: i for i, c in enumerate(input_str)}
    seen = set()

    for i, char in enumerate(input_str):
        if char not in seen:
            while stack and char > stack[-1] and i < last_occurrence[stack[-1]]:
                seen.remove(stack.pop())
            stack.append(char)
            seen.add(char)

    return ''.join(stack)

IONโœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
vector<int> runningMedian(vector<int> arr) {
    priority_queue<int> low;
    priority_queue<int, vector<int>, greater<int>> high;
    vector<int> res;
   
    for (int num : arr) {
        low.push(num);
        high.push(low.top());
        low.pop();
        if (low.size() < high.size()) {
            low.push(high.top());
            high.pop();
        }
        res.push_back(low.top());
    }
    return res;



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

struct Edge {
    int u, v, c;
    bool operator<(const Edge& other) const {
        return c < other.c;
    }
};

int find(vector<int>& parent, int u) {
    if (parent[u] != u) parent[u] = find(parent, parent[u]);
    return parent[u];
}

void unite(vector<int>& parent, vector<int>& rank, int u, int v) {
    int root_u = find(parent, u);
    int root_v = find(parent, v);
    if (root_u != root_v) {
        if (rank[root_u] > rank[root_v]) {
            parent[root_v] = root_u;
        } else if (rank[root_u] < rank[root_v]) {
            parent[root_u] = root_v;
        } else {
            parent[root_v] = root_u;
            rank[root_u]++;
        }
    }
}

long long solve(int n, vector<Edge>& edges) {
    sort(edges.begin(), edges.end());
    vector<int> parent(n + 1), rank(n + 1, 0);
    iota(parent.begin(), parent.end(), 0);
    long long cost = 0;
    int edges_used = 0;
    for (const auto& edge : edges) {
        if (find(parent, edge.u) != find(parent, edge.v)) {
            unite(parent, rank, edge.u, edge.v);
            cost += edge.c;
            edges_used++;
            if (edges_used == n - 1) break;
        }
    }
    return cost;
}

Break and Add โœ…
Google