๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.62K subscribers
5.59K 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 <cmath>

#define MOD 1000000007
#define ll long long
#define vll vector<long long>

using namespace std;

ll solve(ll n) {
    vll v(n + 1);
    v[1] = 2;
    v[2] = 9;
    for (int i = 3; i <= n; i++) {
        v[i] = (4LL * v[i - 1] % MOD - v[i - 2] + 2 * (ll)pow(-1, i)) % MOD;
        v[i] = (v[i] + MOD) % MOD;
    }
    return v[n];
}

vll ways(const vll &nvalues) {
    vll results;
    for (const auto &n : nvalues) {
        results.push_back(solve(n));
    }
    return results;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    ll n;
    cin >> n;

    vll a(n);
    for (ll i = 0; i < n; i++) {
        cin >> a[i];
    }

    vll ans = ways(a);

    for (const auto &result : ans) {
        cout << result << " ";
    }
    cout << endl;

    return 0;
}

Dominos Tilling 3Dโœ…
string WildcardCharacters(string str) {
    vector<string> arr;
    size_t pos = str.find(" ");
    arr.push_back(str.substr(0, pos));
    arr.push_back(str.substr(pos + 1));

    string pattern = arr[0];
    string word = arr[1];

    string regexPtn = "";
    for (size_t i = 0; i < pattern.length(); ++i) {
        if (pattern[i] == '+') {
            regexPtn += "[a-z]";
        }
        if (pattern[i] == '$') {
            regexPtn += "[1-9]";
        }
        if (pattern[i] == '*') {
            if (pattern[i + 1] == '{') {
                regexPtn += ".{" + string(1, pattern[i + 2]) + "}";
                i += 2;
            } else {
                regexPtn += ".{3}";
            }
        }
    }

    regex regexPattern("^" + regexPtn + "$");
    return regex_match(word, regexPattern) ? "true" : "false";
}


#include <regex>
๐Ÿ‘1
public static String atrArr(String[] strArr) {
         int row = 1;
        int col = 0;
        int i = 0;
        while (i < strArr.length) {
            if (strArr[i].equals("<>")) {
                row++;
            }
            i++;
        }
        col = strArr.length / row;
        int[][] matrix = new int[row][col];
        int r = 0;
        int c = 0;
        for (int j = 0; j < strArr.length; j++) {
            if (strArr[j].equals("<>")) {
                r++;
                c = 0;
                continue;
            }
            matrix[r][c] = Integer.parseInt(strArr[j]);
            c++;
        }
        int[][] rref = new int[row][col];
        for (int j = 0; j < row; j++) {
            for (int k = 0; k < col; k++) {
                rref[j][k] = matrix[j][k];
            }
        }
        int lead = 0;
        for (int j = 0; j < row; j++) {
            if (col <= lead) {
                break;
            }
            int i1 = j;
            while (rref[i1][lead] == 0) {
                i1++;
                if (row == i1) {
                    i1 = j;
                    lead++;
                    if (col == lead) {
                        lead--;
                        break;
                    }
                }
            }
            for (int k = 0; k < col; k++) {
                int temp = rref[j][k];
                rref[j][k] = rref[i1][k];
                rref[i1][k] = temp;
            }
            int div = rref[j][lead];
            for (int k = 0; k < col; k++) {
                rref[j][k] = rref[j][k] / div;
            }
            for (int k = 0; k < row; k++) {
                if (k != j) {
                    int sub = rref[k][lead];
                    for (int l = 0; l < col; l++) {
                        rref[k][l] = rref[k][l] - (sub * rref[j][l]);
                    }
                }
            }
            lead++;
        }
        String result = "";
        for (int j = 0; j < row; j++) {
            for (int k = 0; k < col; k++) {
                result += rref[j][k];
            }
        }
        return result;
    }

RREEF MAtrix โœ…
Hello All,

We do have 40 Opening for Automation Fresher

Location :Pune

Interview Process :

   1. Aptitude Test
   2. F2F interview
   3. Manager Round
   4. HR interview
 
Package - 8 Lacs (6 Lacs Fixed +  2 Lacs Joining Bonus)

Passout Year - 2019 to 2023

Java, logically Strong, technical knowledge on Java, C# or python. Data Base. Or any courses or certification candidate did was additional advantage.

Interested people send your resume on hr@qapenguin.com

Thanks,
Team Knowledgeware Training Institute and QAPenguin Pvt Ltd
We are recruiting for the Junior Software Testing Engineer role.

Qualification: B.Sc (CS, IT, CT, CA) B.E (CS, IT, ECE) B.Tech, M.Sc (CS) M.C.A
Location: Tamil Nadu
CTC: 1 LPA to 3 LPA
Work Mode: Remote (6 Working Days)
Training Period: 6 Months for Fresher

Selection Process:
- Technical Assessment Test
-Communication Testing
- Technical Round with QA Team

Requirements:
- 0-3 years of experience in manual testing and automation
-Excellent logical and analytical skills
-Good communication skills (reading, writing, and spoken)
-Good problem-solving skills
- Knowledge about web services, databases (SQL), and data structures
- Flexibility to work in shifts
- Prioritization and time management

Send your resume to: mohanraj.k@desicrew.in
๐Ÿ‘1
HDFC Bank is hiring [fresher / experienced] CAs/MBA( finance ) for the Internal Audit role.

Interested candidates can send their resume at carishabbhatia@gmail.com

Use below mentioned subject for Email
If Fresher :-
CA/MBA_ Fresher_Internal Audit

If Experienced:-
CA/MBA _Experience(yrs)_Profile worked in past
public static Map<Character, Integer> calculateFrequency(String word) {
        Map<Character, Integer> freqMap = new HashMap<>();

        for (char c : word.toCharArray()) {
            freqMap.put(c, freqMap.getOrDefault(c, 0) + 1);
        }

        for (Map.Entry<Character, Integer> entry : freqMap.entrySet()) {
            entry.setValue(entry.getValue() / 2);
        }

        return freqMap;
    }

Minimum Length Word โœ…
def max_zeros(L, K):

    if K == 0:

        return L

    zeros = L - K

    max_length = zeros // (K + 1)

    remaining = zeros % (K + 1)

    if remaining > 0:

        max_length += 1

    return max_length

L, K = map(int, input().split())

print(max_zeros(L, K),end="")

Zero Count โœ…
#include<bits/stdc++.h>
using namespace std;

int main() {
    int L, K;
    cin >> L >> K;
    if(K == 0) {
        cout << L << endl;
    }
    else {
        int z = L - K;
        int maxi = z / (K + 1);
        if(z % (K + 1) != 0) {
            maxi++;
        }
        cout << maxi << endl;
    }
    return 0;
}

Zero Count โœ…
def calc_valency(element):
    return sum(map(int, str(sum(map(int, map(str, map(ord, element))))))) % 9 or 9

def balance_compound(compound, eq_point):
    elem1, elem2 = compound[0], compound[1]

    val1, val2 = calc_valency(elem1), calc_valency(elem2)
    results = []

    for mult1 in range(1, eq_point // val1 + 1):
        rem_point = eq_point - mult1 * val1
        if rem_point % val2 == 0:
            mult2 = rem_point // val2
            results.append(f"{elem1}{mult1} {elem2}{mult2}")

    for i in range(len(results) - 2, -1, -1):
        print(results[i])

    if not results:
        print("Not Possible")


compound_input = input().strip()
equivalent_point_input = int(input().strip())

balance_compound(compound_input, equivalent_point_input)

Compound โœ…
Codevita
๐Ÿ‘1
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int solve(string r) {
    int c = 0;
    for (int i = 0; i < r.size() - 2; i++) {
        if (r[i] != r[i+1] && r[i+1] != r[i+2]) {
            c++;
        }
    }
    return c;
}

int main() {
    string r1, r2;
    cin >> r1 >> r2;

    if (count(r1.begin(), r1.end(), 'M') + count(r1.begin(), r1.end(), 'L') != r1.size() ||
        count(r2.begin(), r2.end(), 'M') + count(r2.begin(), r2.end(), 'L') != r2.size()) {
        cout << "Invalid input" << endl;
        return 0;
    }

    int s1 = solve(r1);
    int s2 = solve(r2);

    if (s1 > s2) {
        cout << "Ashok" << endl;
    } else if (s2 > s1) {
        cout << "Anand" << endl;
    } else {
        cout << "Draw" << endl;
    }

    return 0;
}

Orchad โœ…
Codevita