๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.52K subscribers
5.56K photos
3 videos
95 files
9.68K 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<bits/stdc++.h>
using namespace std;

int dp[205][205][2];
int arr[205][205];

int solve(int i, int j, int d, int m, int n) {
    if(i<0 i>=m j<0 j>=n arr[i][j]==-1) return 0;
    if(dp[i][j][d] != -1) return dp[i][j][d];
    int res = arr[i][j];
    if(d == 0) {
        res += max(solve(i, j+1, d, m, n), solve(i+1, j, 1-d, m, n));
    } else {
        res += max(solve(i, j-1, d, m, n), solve(i+1, j, 1-d, m, n));
    }
    dp[i][j][d] = res;
    return res;
}

int main() {
    int t;
    cin >> t;
    while(t--) {
        int m, n;
        cin >> m >> n;
        for(int i=0; i<m; i++) {
            for(int j=0; j<n; j++) {
                char c;
                cin >> c;
                if(c == '1') arr[i][j] = 1;
                else if(c == '0') arr[i][j] = 0;
                else arr[i][j] = -1;
            }
        }
        memset(dp, -1, sizeof(dp));
        cout << max(solve(0, 0, 0, m, n), arr[0][0] + solve(0, 0, 1, m, n)) << endl;
    }
    return 0;
}

Compro โœ…
int main() {
    int a, b, c, d;
    int i;
    double j;

    cin >> a >> b >> c >> d;

    for (i = 0; i <= 100; ++i) {
        j = (double)(b + a * i - d) / c;

        if (j >= 0 && j == (int)(j)) {
            cout << b + a * i << endl;
            return 0;
        }
    }

    cout << "-1" << endl;

    return 0;
}

Compro โœ…
ll n,a,b,c;
     cin>>n>>a>>b>>c;
     ll ans=0;
     if(n>1)
     {
         ans+=min(a,b);
         n--;
         ll x=min(a,min(b,c));
         while(n!=1)
         {
             ans+=x;
             n--;
         }
     }
     cout<<ans<<endl;
Analyst Position at Dassault Systรจmes

Location - Pune

Qualifications/Experience:
- Bachelorโ€™s Degree in Business, Finance, or Accounting (equivalent work experience considered)
- 0 to 1-year experience in finance and accounting streams preferred
- Excellent communication skills (verbal and written)
- Proficient with MS Office (Excel, Word, and PowerPoint)
- Strong analytical skills and a good team player
- Keen learner with a positive attitude
- Structured, disciplined, and flexible approach towards work
- Ability to work in cross-functional teams with a solution-finding approach
- Able to work in multiple and culturally different environments
- Able to maintain high quality in all deliverables and according to the operating principles
- Education: BCom/BCA/MCom/MBA-Finance/MBA-Marketing (Only passouts candidates)
- Immediate Joiners will be preferred

Interested candidates, please send your CV to

ganesh.thik@3ds.com
#include <iostream>
#include <vector>

using namespace std;

vector<vector<int>> Availability(int N, vector<int> L, vector<int> R) {
    int cur = 0;
    vector<vector<int>> ans;
if (N == 0) {
        ans.push_back({0, 1000000000});
     }
    for (int i = 0; i < N; i++) {
        if (cur < L[i]) {
            ans.push_back({cur, L[i]});
        }
        cur = R[i];
    }

    if (cur < 1000000000) {
        ans.push_back({cur, 1000000000});
    }

    return ans;
}

Availability โœ…
vector<string> solve(string t, int Q, vector<string> q) {
    stringstream ss(t);
    string tk;
    vector<string> p;
    while (getline(ss, tk, '\"')) {
        p.push_back(tk);
    }

    vector<string> r;
    for (string qry : q) {
        size_t pos = qry.find_last_of('.');
        qry = qry.substr(pos + 1);
        int j = 0;
        for (j = 0; j < p.size(); j++) {
            if (p[j] == qry) {
                break;
            }
        }
        r.push_back(p[j + 2]);
    }
    return r;
}

Json parsing โœ…
#include<bits/stdc++.h>
using namespace std;
    
int findMessages (int N, vector<string> A) {
    int ans=N;
    set<string> st;

    for(int i=0; i<N; i++) {
        string s;
        for(int j=0; j<A[i].size(); j++)
            s += 'a' + ('z' - A[i][j]);
       
        if (st.find(s) != st.end())
            ans -= 1;

        st.insert(A[i]);
    }

    return ans;
}
    
int main() {
    
    ios::sync_with_stdio(0);
    cin.tie(0);
    int N;
    cin >> N;
    vector<string> A(N);
    for(int i_A = 0; i_A < N; i_A++)
    {
        cin >> A[i_A];
    }
    
    int out_;
    out_ = findMessages(N, A);
    cout << out_;
}

Alice and messages โœ…
def solve(N, A, D, V):
    info_index = {
        'bank_account_number': 0,
        'account_holder_first_name': 1,
        'account_holder_last_name': 2,
        'registered_mobile_number': 3,
        'branch_code': 4
    }
   
    filtered_accounts = [account for account in A if str(account[info_index[D]]) == V]
    sorted_accounts = sorted(filtered_accounts, key=lambda x: int(x[0]))

    output = "\n".join([" ".join(map(str, account)) for account in sorted_accounts])
    return output

N = int(input())
A = []
for _ in range(N):
    account_info = input().split()
    account_info[0] = int(account_info[0])
    account_info[3] = int(account_info[3])
    account_info[4] = int(account_info[4])
    A.append(account_info)

D = input()
V = input()

result = solve(N, A, D, V)
print(result)

Searching google pay saved account โœ…
def getSeatsAllocation(arr):
    n = len(arr)
    ppl = [[] for i in range(2 * n + 4)]
   
    for i, x in enumerate(arr):
        ppl[x].append(i)

    h = []
    ans = [-1] * n
   
    for pos in range(1, 2 * n + 1):
        for i in ppl[pos]:
            heapq.heappush(h, (-pos, i))
       
        if len(h) > 0:
            ans[heapq.heappop(h)[1]] = pos
   
    return ans

Queued Seats โœ…
int lastStoneWeight(vector<int>& stones) {
    priority_queue<int> pq;
        for(auto &i: stones) pq.push(i);
       
        int a,b;
        while(pq.size()>1){
            a=pq.top();pq.pop();
            b=pq.top();pq.pop();
            if(a!=b)pq.push(abs(a-b));         
        }
        if(pq.empty())return 0;
        return pq.top();
    }

Last stone weight
Nivedia โœ…
vector<int> solve(int N, const vector<vector<int>>& A, const vector<vector<int>>& queries) {
    vector<int> results;
    results.reserve(queries.size());

    for (const auto& query : queries) {
        int l = query[0];
        int r = query[1];
        int x = query[2];
        int count = 0;

        for (int i = l - 1; i < r; ++i) {
            if (A[i][1] > x) {
                ++count;
            }
        }

        results.push_back(count);
    }

    return results;
}

//Partial 6/10

Tax Payment โœ…
def PowerLimit(a, b):
  current_resource, max_seconds = 1, 0
  while a > 0 and b > 0:
    if a > b:
      current_resource, a, b = 1, a - 2, b + 1
    else:
      current_resource, b, a = 2, b - 2, a + 1
    max_seconds += 1
  max_seconds += a // 2 if current_resource == 1 else b // 2
  return max_seconds

power limit โœ