๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.6K photos
3 videos
95 files
10.2K 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 solution(const vector<int>& A, const vector<int>& B) {
    int N = A.size();

     vector<vector<int>> dp(2, vector<int>(N));
    dp[0][0] = A[0];
    dp[1][0] = max(A[0], B[0]);

    for (int j = 1; j < N; ++j) {
        dp[0][j] = max(dp[0][j - 1], A[j]);
        dp[1][j] = min(max(dp[0][j], B[j]), max(dp[1][j - 1], B[j]));
    }

    return dp[1][N - 1];
}

Amex โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <set>
#include <iomanip>
#include <sstream>
using namespace std;
bool isInteresting(const string& timeStr) {
    set<char> uniqueDigits;
        for (char ch : timeStr) {
        if (ch != ':') {
            uniqueDigits.insert(ch);
        }
    }
        return uniqueDigits.size() <= 2;
}
void incrementTime(int& hh, int& mm, int& ss) {
    ss++;
    if (ss == 60) {
        ss = 0;
        mm++;
    }
    if (mm == 60) {
        mm = 0;
        hh++;
    }
    if (hh == 24) {
        hh = 0;
    }
}
string timeToString(int hh, int mm, int ss) {
    ostringstream oss;
    oss << setw(2) << setfill('0') << hh << ":"
        << setw(2) << setfill('0') << mm << ":"
        << setw(2) << setfill('0') << ss;
    return oss.str();
}
int solve(const string& S, const string& T) {
    int shh = stoi(S.substr(0, 2));
    int smm = stoi(S.substr(3, 2));
    int sss = stoi(S.substr(6, 2));
    int ehh = stoi(T.substr(0, 2));
    int emm = stoi(T.substr(3, 2));
    int ess = stoi(T.substr(6, 2));
    int interestingCount = 0;
        while (true) {
        string currentTime = timeToString(shh, smm, sss);
                if (isInteresting(currentTime)) {
            interestingCount++;
        }
                if (shh == ehh && smm == emm && sss == ess) {
            break;
        }
                incrementTime(shh, smm, sss);
    }
   
    return interestingCount;
}


Amex โœ…
long long solve(int n, int** A) {
    vector<pair<int, int>> vp;
    vp.push_back({-1, 0});

    for (int i = 0; i < n; i += 1) {
        vp.push_back({A[i][1], A[i][2]});
    }

    sort(vp.begin(), vp.end());

    auto check = [&] (int mid) {
        long long dishes = 0;

        for (int i = 1; i <= n; i += 1) {
            dishes += static_cast<long long>(vp[i].first - vp[i - 1].first) * mid;
            if (vp[i].second > dishes)
                return false;
            else
                dishes -= vp[i].second;
        }

        return true;
    };

    int l = 0, r = 1e9;

    while (r - l > 1) {
        int mid = (l + r) / 2;
        if (!check(mid))
            l = mid;
        else
            r = mid;
    }

    return r;
}

Chef and ordering โœ…
from math import ceil

def getMinDifference(n, e1, t1, e2, c):
    res = float('inf')
    
    energy_list = [e1 * i for i in range(n + 1)]

    for i in range(n + 1):
        lift = i * t1
        energy = energy_list[i]

        if energy < (n - i) * e2:
            continue

        steps = 0
        
        steps_list = [ceil(c / energy) for _ in range(n - i)]
        energy -= sum(steps_list) * e2

        res = min(res, abs(lift - sum(steps_list)))

    return res

Meesho โœ…
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <iostream>
#include <vector>
#include <algorithm> 
#include <cstring>
using namespace std;

const int MOD = 1e9 + 7;
int dp[20][200][200][2];
vector<int> getDigits(int x) {
    vector<int> digits;
    while (x > 0) {
        digits.push_back(x % 10);
        x /= 10;
    }
    reverse(digits.begin(), digits.end());
    return digits;
}
int digitDP(int pos, int sumEven, int sumOdd, int tight, const vector<int>& digits) {
    if (pos == digits.size()) {
        return (sumEven % 2 == sumOdd % 2) ? 1 : 0;
    }
    if (dp[pos][sumEven][sumOdd][tight] != -1) {
        return dp[pos][sumEven][sumOdd][tight];
    }

    int limit = tight ? digits[pos] : 9;
    int res = 0;
    for (int digit = 0; digit <= limit; ++digit) {
        int newTight = (tight && (digit == digits[pos]));
        if (pos % 2 == 0) {
            res = (res + digitDP(pos + 1, sumEven + digit, sumOdd, newTight, digits)) % MOD;
        } else {
            res = (res + digitDP(pos + 1, sumEven, sumOdd + digit, newTight, digits)) % MOD;
        }
    }
    return dp[pos][sumEven][sumOdd][tight] = res;
}
int countNumbersWithSameParityOfSums(int x) {
    if (x <= 0) return 0;
   
    vector<int> digits = getDigits(x);
    memset(dp, -1, sizeof(dp));
    return digitDP(0, 0, 0, 1, digits);
}
int findParityCountInRange(int a, int b) {
    int result_b = countNumbersWithSameParityOfSums(b);
    int result_a = countNumbersWithSameParityOfSums(a);
        return (result_b - result_a + MOD) % MOD;
}


Meesho โœ…
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
const int MOD = 1e9 + 7;
int getExpressionSums(string num) {
    int n = num.size();
    long long res = 0;
    for (int mask = 0; mask < (1 << (n - 1)); ++mask) {
        string s = ""; 
        s += num[0];
        for (int i = 0; i < n - 1; ++i) {
            if (mask & (1 << i)) {
                s += '+'; 
            }
            s += num[i + 1]; 
        }
        long long current_sum = 0;
        string temp = "";
        for (char c : s) {
            if (c == '+') {
                current_sum += stoll(temp);
                temp = "";
            } else {
                temp += c; 
            }
        }
        current_sum += stoll(temp); 

        res = (res + current_sum) % MOD; 
    }

    return res;
}


Meesho โœ…
https://www.linkedin.com/posts/hinamika-jain_joinourteam-qaengineer-qainterns-activity-7238896001250402305-oDuL?utm_source=share&utm_medium=member_desktop

๐Ÿš€ Apna Mart ๐—ถ๐˜€ ๐—›๐—ถ๐—ฟ๐—ถ๐—ป๐—ด ๐—ค๐—” ๐—˜๐—ป๐—ด๐—ถ๐—ป๐—ฒ๐—ฒ๐—ฟ๐˜€ ๐—ฎ๐—ป๐—ฑ ๐—œ๐—ป๐˜๐—ฒ๐—ฟ๐—ป๐˜€! ๐Ÿš€

Apna Mart is seeking for QA Engineers and QA interns to join our dynamic team! If youโ€™re passionate about delivering high-quality softwares and making a real impact, this is the role for you.

Key Requirements:

- Develop and execute comprehensive test plans and cases
- Collaborate closely with development teams to ensure high-quality product delivery
- Identify and track defects, working closely with developers for resolution
- Stay up-to-date with the latest QA methodologies and technologies
- Excellent analytical and problem-solving skills
- Collaborative mindset and attention to detail
- Strong experience in manual and automation testing for web and mobile applications

Ready to elevate your QA career? Apply now and join us for something exciting! ๐ŸŒŸ

How to Apply for QA Engineer:
๐Ÿ“ง Email your resume to: hinamika.jain@apnamart.in
Subject: [Current Designation] + [YOE in QA] + [Current Base]
(Example: QAE + 2 YOE + 7 LPA)

How to Apply for QA Intern:
๐Ÿ“ง Email your resume to: hinamika.jain@apnamart.in
Subject: QAI
๐Ÿ‘1
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
Photo
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;

int dp[1010][2][2][2];

int findParityCountInRange(string a, string b)
{

    function<int(int, int, int, int, string &)> f = [&](int pos, int even, int odd, int tight, string &s) -> int
    {
        if (pos == s.size())
            return (even == odd) ? 1 : 0;

        int &ans = dp[pos][even][odd][tight];
        if (ans != -1)
            return ans;

        ans = 0;
        int limit = tight ? (s[pos] - '0') : 9;

        for (int digit = 0; digit <= limit; ++digit)
        {
            int newTight = tight && (digit == (s[pos] - '0'));
            if (pos & 1)
                ans = (ans + f(pos + 1, even, (odd + digit) % 2, newTight, s)) % MOD;
            else
                ans = (ans + f(pos + 1, (even + digit) % 2, odd, newTight, s)) % MOD;
        }

        return ans;
    };

    memset(dp, -1, sizeof dp);
    int ansA = f(0, 0, 0, 1, a);
    memset(dp, -1, sizeof dp);
    int ansB = f(0, 0, 0, 1, b);

    return (ansB - ansA + MOD) % MOD;
}

int main()
{
    string a, b;
    cin >> a >> b;

    cout << findSameParityIntegers(a, b) << endl;

    return 0;
}

Meesho โœ…
๐Ÿ‘2