๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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
Gadgeon Systems Inc. Hiring Fresher Firmware Engineer Intern ๐Ÿš€

Job Designation : Firmware Intern

Requirements and Skills
โ€ข  Degree - B.Tech/ M.Tech
โ€ข  Solid programming experience in C or C++
โ€ข  Team Player, can work well with maintaining track of projects

Interested candidates please apply on nithya.km@gadgeon.com
Internship Opportunity!

BDO India is hiring interns for its Actuarial Team.
Candidates should be graduates and must have cleared at least 3 CT Papers, including CM1.
Preferred skills include knowledge of Excel, R, and Python.
Location: Mumbai/Gurugram with a hybrid working model.

If you know someone who would be a great fit, please recommend them or reach out to Shilpy Kalia at shilpykalia@bdo.in with the subject line "BDO India - Actuarial Intern."
#include <bits/stdc++.h>
using namespace std;
void f(int i,int m,int down, int power,int& ans){
    if (i > m+2) return;
    if (i < 0) return;
    if(i == m) ans++;
    f(i+pow(2,power),m,1,power+1,ans);
    if (down)
    {
        f(i-1,m,0,power,ans);
    }
}

int solve(int m){
    int ans = 0;
    f(1,m,1,0,ans);
    return ans;
}


Game of stairs โœ…
#include <bits/stdc++.h>
#define ll long long 
using namespace std;    
signed main()
{
     ll sz,n; cin>>sz>>n;
     vector<ll>a(n);
     for(ll i=0;i<n;i++) cin>>a[i];
     vector<vector<ll>>ans;
     for(ll i=0;i<sz-1;i++) a.insert(a.begin(),0);
     reverse(a.begin(),a.end());
     for(ll i=0;i<n;i++)
     { 
        vector<ll>curr;
        for(ll j=i;j<i+sz;j++) curr.push_back(a[j]);
        ans.push_back(curr);
     }
      reverse(ans.begin(),ans.end());
      for(ll i=0;i<ans.size();i++)
      {
        for(ll j=0;j<ans[i].size();j++) cout<<ans[i][j]<<" ";
        cout<<endl;
      }
    return 0;
}
๐Ÿ‘1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
vector<int> ttl_cache(int n, vector<vector<int>> entries, vector<int> queries){
    int q = queries.size();

    vector<pair<int,int>> arr;
    for(int i=0;i<q;i++){
        arr.push_back({queries[i],i});
    }
    sort(arr.begin(),arr.end());

    vector<int> res(q);
    pbds st;

    int i=0;
    int x = arr[i].first;
    sort(entries.begin(), entries.end());
    for(auto &v:entries){
        while(v[0]>x){
            res[arr[i].second] = st.size() - st.order_of_key(x);
            i++;
            if(i==q) return res;
            x = arr[i].first;
        }
        st.insert(v[0]+v[1]);
    }

    for(;i<q;i++){
        x = arr[i].first;
        res[arr[i].second] = st.size() - st.order_of_key(x);
    }
    return res;
}


TTL Cache โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
int countBits(int v) { 
    int count = 0;
    while (v > 0) {
        count += v & 1;
        v >>= 1;
    }
    return count;
}

string palindromeChecker(string s, vector<int> startIndex, vector<int> endIndex, vector<int> subs) {
    int bp = 0;
    string myString = "";
    vector<int> L;
    L.push_back(bp);

    for (char i : s) {
        int ci = i - 'a';
        bp = bp ^ (1 << ci);
        L.push_back(bp);
    }

    int q = startIndex.size();
    int c1 = L[startIndex[0]];
    int c2 = L[endIndex[0] + 1];
    int di = c1 ^ c2;
    int ooc = countBits(di);
    bool r = (ooc - subs[0] * 2) <= 1;

    if (r) {
        myString = "1";
    } else {
        myString = "0";
    }

    return myString;
}


Can you make a palindrome
BNY Mellon โœ…
โค1๐Ÿคฉ1
def count_subsequences(s1, s2):
    m, n = len(s1), len(s2)
    dp = [[0] * (n + 1) for _ in range(m + 1)]

    for j in range(n + 1):
        dp[0][j] = 1

    for i in range(1, m + 1):
        for j in range(1, n + 1):
            if s1[i - 1] == s2[j - 1]:
                dp[i][j] = dp[i][j - 1] + dp[i - 1][j - 1]
            else:
                dp[i][j] = dp[i][j - 1]

    return dp[m][n]

Source : Hola โœ