๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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
def solve(L, R):
    def first_digit(n):
        while n >= 10:
            n //= 10
        return n
   
    count = 0
    for number in range(L, R + 1):
        if first_digit(number) == number % 10:
            count += 1
   
    return count

Unsafe Password โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include<bits/stdc++.h>
#define ll long long
using namespace std;
vector<pair<ll,ll>>solve(ll n,ll m)
{
    vector<pair<ll,ll>>path;
    ll x=0,y=0;
    ll dx=1,dy=1;
    while(1)
    {
        path.push_back({x, y});
        ll nx=x+dx;
        ll ny=y+dy;
        if(nx<0 or nx>=n) dx=-dx;
        if(ny<0 or ny>=m) dy=-dy;
        x+=dx;
        y+=dy;
        if((x==0 && y==0) or (x==0 && y==m-1) or (x==n-1 && y==0) or (x==n-1 && y==m-1))
        {
            path.push_back({x,y});
            break;
        }
    }
    return path;
}
signed main()
{
    ll n,m; cin>>n>>m;
    auto ans=solve(n,m);
    for(ll i=0;i<ans.size();i++)
    {
        cout<<ans[i].first<<" "<<ans[i].second;
        if(i!=ans.size()-1) cout<<", ";
    }

  
}


A Ray of Light
Culfit โœ…
#include <bits/stdc++.h>
#define ll long long
using namespace std;
class FenwickTree {
public:
    FenwickTree(ll n) : bit(n + 1, 0) {}

    void update(ll index, ll value) {
        for (; index < bit.size(); index += index & -index) {
            bit[index] += value;
        }
    }

    ll query(ll index) const {
        ll sum = 0;
        for (; index > 0; index -= index & -index) {
            sum += bit[index];
        }
        return sum;
    }

    ll rangeQuery(ll left, ll right) const {
        return query(right) - query(left - 1);
    }

private:
    vector<ll> bit;
};
ll solve(vector<ll>& a)
{
    ll n=a.size()-1;
    vector<ll>compressed(n+1);
    vector<ll>values(a.begin()+1,a.end());
    sort(values.begin(),values.end());
    values.erase(unique(values.begin(),values.end()),values.end());
    for (ll i=1;i<=n;i++)
    {
        a[i]=lower_bound(values.begin(),values.end(),a[i])-values.begin()+1;
    }
    FenwickTree fenwick(n);
    ll count=0;
    for (ll j=2;j<=n;j++)
    {
        if (a[j]<j) count+=fenwick.query(a[j]-1);
        if (a[j-1]<j-1) fenwick.update(a[j-1],1);
    }
    return count;
}
signed main()
{
    ll n; cin>>n;
    vector<ll>a(n+1);
    for (ll i=1;i<=n;i++)  cin >> a[i];
    cout <<solve(a)<<endl;
    return 0;
}


Pairs of equality
Culfit โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
using namespace std;
const int MOD = 1e9 + 7;
int countValidSeries(int n, int m, vector<int>& f) {
    vector<vector<int>> dp(n + 1, vector<int>(m + 1, 0));
    if (f[0] == 0) {
        for (int j = 1; j <= m; ++j) {
            dp[1][j] = 1;
        }
    } else {
        dp[1][f[0]] = 1;
    }
    for (int i = 2; i <= n; ++i) {
        if (f[i-1] == 0) {
            for (int j = 1; j <= m; ++j) {
                dp[i][j] = dp[i-1][j];
                if (j > 1) dp[i][j] = (dp[i][j] + dp[i-1][j-1]) % MOD;
                if (j < m) dp[i][j] = (dp[i][j] + dp[i-1][j+1]) % MOD;
            }
        } else {
            int j = f[i-1];
            dp[i][j] = dp[i-1][j];
            if (j > 1) dp[i][j] = (dp[i][j] + dp[i-1][j-1]) % MOD;
            if (j < m) dp[i][j] = (dp[i][j] + dp[i-1][j+1]) % MOD;
        }
    }
    int result = 0;
    for (int j = 1; j <= m; ++j) {
        result = (result + dp[n][j]) % MOD;
    }
    return result;
}


Flight Series Counter โœ…
L&T Technology Services - MBA Intern Hiring โ€“ 2024 or 2025 pass out batch.

Please register using the below link: https://forms.office.com/pages/responsepage.aspx?id=eDMbMYqOXkujP-gKPYumClSsrm1sEv1BmOXg5_0vsfxUOUY2WUU1MUpRWlBROUtMSFFaSDRSOFZHRi4u

** Please note that applicants that do not fill the above form will not be considered.
Registration End Date: 6:00PM, 31st July 2024

Type: Full time Offline Internship
Location:  Mysore
Specialization:  B. Tech + Mba in Sales & Marketing
Year of Pass out: Batch of 2024 or 2025
Stipend: As per Industry Standards

Job Brief:
    - A Presales Intern acts as a bridge between the sales and technical teams, providing valuable insights and solutions to potential clients.
    -  This role involves a strategic approach to understanding client needs and aligning product or service offerings accordingly.

Requirement and Skills:
    - Excellent communication and presentation skills.
    - Strong analytical and problem-solving abilities.
    - Ability to work collaboratively in a fast-paced and dynamic environment.
๐Ÿ˜ฑ1