๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
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
bool help(int n,unordered_set<char>&mpp)
{
    string s=to_string(n);
    for(auto it:s)
    {
        if(mpp.count(it)) return 1;
    }
    return 0;
}
int solve(vector<int>&a,int n)
{
    sort(a.begin(),a.end());
    int maxi=a[n-1];
    string s=to_string(maxi);
    unordered_set<char>mpp;
    for(auto it:s) mpp.insert(it);

    int ans=-1;
    for(int i=0;i<n-1;i++)
    {
        if(help(a[i],mpp)==0) ans=a[i];
    }
    if(ans==-1) return -1;
    return ans+maxi;
}

Microsoft โœ…
Budget planning โœ…

#include <bits/stdc++.h>


using namespace std;

int n;
int a[30];
int memo[1 << 23];
int inf = 100;

int solve(int flag){
  if(memo[flag] != -1) return memo[flag];
  if(flag == 1) return 1;

  int ret = inf;
  int b = __builtin_popcount(flag);
  for(int i = n - 1; i >= 0; i--){
    if(flag & (1 << i)){
      int next = (flag ^ (1 << i)) | (1 << (i - 1));
      for(int j=0;j<i;j++)for(int k=0;k<j+1;k++){
        if(a[j] + a[k] == a[i]){
          int tmp = solve(next | (1 << j) | (1 << k));
          if(tmp != inf){
            ret = min(ret, max(b, tmp));
          }
        }
      }
      break;
    }
  }

  return memo[flag] = ret;
}

int main(){
cin>>n;

  for(int i=0;i<n;i++)
  {cin>>a[i];
  }
  memset(memo, -1, sizeof(memo));
  int ans = solve(1 << (n - 1));
  if(ans == inf) ans = -1;
cout<<ans<<endl;
}
Minimum contrast โœ…

#include<bits/stdc++.h>
using namespace std;

#define mod 1000000007
#define N 300009


int dp[59][59];
string s[N],t,p,ans;

int f(int i,int j)
{
    if(i==t.size())
        return p.size()-j;
    if(j==p.size())
        return t.size()-i;
    if(dp[i][j]!=-1)
        return dp[i][j];
    if(t[i]==p[j])
        return dp[i][j] = f(i+1,j+1);
    return dp[i][j] = 1 + min({ f(i+1,j), f(i,j+1), f(i+1,j+1)});
}

int main()
{
  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
   int n;
   cin>>n;
   int i=0;
   while(i<n)
       cin>>s[i++];
    
     int q,best,j,k;
    
     cin>>q;
     while(q--)
     {
         cin>>t;
         best=INT_MAX;
         i=0;
         while(i<n)
         {
             p=s[i];
             j=0;
             while(j<t.size())
             {
                 k=0;
                 while(k<p.size())
                 {
                     dp[j][k]=-1;
                     k++;
                 }
                 j++;
             }
             j=f(0,0);
             if(j<best)
             {
                 best=j;
                 ans=p;
             }
             i++;
         }
         cout << ans << "\n";
     }
}
Auto Suggest โœ…

#include <bits/stdc++.h>
using namespace std;

int min(int x, int y, int z)
{
    return min(min(x, y), z);
}

int levenshteinDist(string str1, string str2, int m, int n)
{
    int dp[m + 1][n + 1];

    for (int i = 0; i <= m; i++)
    {
        for (int j = 0; j <= n; j++)
        {
            if (i == 0)
                dp[i][j] = j;

            else if (j == 0)
                dp[i][j] = i;

            else if (str1[i - 1] == str2[j - 1])
                dp[i][j] = dp[i - 1][j - 1];

            else
                dp[i][j] = 1 + min(dp[i][j - 1],     
                                   dp[i - 1][j],     
                                   dp[i - 1][j - 1]);
        }
    }

    return dp[m][n];
}

int main()
{
    int n;
    cin >> n;
  
    vector<string> v(n);
    for (int i = 0; i < n; ++i)
    {
        cin >> v[i];
     
    }
    string s;
    cin >> s;
   
    int mindist = INT_MAX;
    string beststr = "zzzzzzzzzzz";

    for (int i = 0; i < n; ++i)
    {
        int heredist = levenshteinDist(s, v[i], s.size(), v[i].size());
        if (heredist < mindist)
        {
            mindist = heredist;
            beststr = v[i];
            continue;
        }
        if (heredist == mindist)
        {
            if (beststr > v[i])
            {
                // cout << beststr << " " << v[i] << "\n";
                beststr = v[i];
            }
            continue;
        }
    }

    cout << beststr;

    return 0;
}
๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
bool help(int n,unordered_set<char>&mpp) {     string s=to_string(n);     for(auto it:s)     {         if(mpp.count(it)) return 1;     }     return 0; } int solve(vector<int>&a,int n) {     sort(a.begin(),a.end());     int maxi=a[n-1];     string s=to_string(maxi);โ€ฆ
#include <iostream>
#include <vector>
#include <unordered_set>
#include <algorithm>

using namespace std;

bool hasCommonDigits(int num1, int num2) {
unordered_set<char> digits1, digits2;
string str1 = to_string(num1);
string str2 = to_string(num2);

for (char digit : str1) {
digits1.insert(digit);
}

for (char digit : str2) {
digits2.insert(digit);
}

for (char digit : digits1) {
if (digits2.count(digit) > 0) {
return true;
}
}
return false;
}

int solution(vector<int>& A) {
sort(A.rbegin(), A.rend());

for (size_t i = 0; i < A.size(); ++i) {
bool hasCommon = false;
for (size_t j = i + 1; j < A.size(); ++j) {
if (!hasCommonDigits(A[i], A[j])) {
return A[i] + A[j];
}
}
}

return -1;
}. //microsoft task 1
def find_different_evenness_index(n, numbers):
    odd_count = even_count = 0
    odd_index = even_index = 0

    for i, num in enumerate(numbers):
        if num % 2 == 0:
            even_count += 1
            even_index = i + 1
        else:
            odd_count += 1
            odd_index = i + 1

    return odd_index if even_count > odd_count else even_index

n = int(input())
numbers = list(map(int, input().split()))

result = find_different_evenness_index(n, numbers)
print(result)

Accenture โœ…
void solve(string s) {
    unordered_map<char, int> m;
    for (char c : s) {
        m[c]++;
    }

    string result = "";
    for (char c : s) {
        while (m[c] > 0) {
            result += c;
            m[c]--;
        }
    }

   
    cout << result << endl;
}. 

Count all occurrences of character  โœ…
Nvidia
int lastStoneWeight(vector<int>& s) {
    priority_queue<int> q(s.begin(), s.end());
    while (q.size() > 1) {
        int a = q.top();
        q.pop();
        int b = q.top();
        q.pop();
        if (a != b) {
            q.push(a - b);
        }
    }
    return q.empty() ? 0 : q.top();
}   NVIDIA   :))

Smashing stones โœ…
๐Ÿ‘1
Infinite Computer Solutions recruiting #Freshers for IT - Software Engineer roles.

Designation: Associate Software Engineer
Experience: 0-1 Years
Education: BSc/ BCA/12th + 3years Diploma (2022/2023/2024 Pass out)
Work mode: Rotational shifts and flexible hours.
CTC - 3.5 LPA
Work Location: Chennai and Bangalore
Interview Mode: Virtual Interview or F2F post profile shortlisted.

Kindly share resume to following mail id - Urvashi.Kishor@infinite.com
๐Ÿ‘1
We are seeking for Fresher React JS developers.
Location: Indore (Work From Office)

Eligibility Criteria:
1. Must have done internship of 3-6 months in React JS.
2. Educational Qualification: BE/B.tech (CS), BCA/MCA, B.sc/M.sc (CS)
3. Immediate Joiner

Interested candidates please share your updated resume at reema.p@preciousinfosystem.com
Tata Elxsi is looking for some potential fresher for our SIS department (IT support role) in Navi Mumbai  

JD For CS Requirement:

Bachelorโ€™s degree but CS, IT, ECE, & MCA (preferred)

Minimum 60% is required in 10th, 12th and Graduation/Post Graduation.
Any scripting/automation or programming knowledge is preferred.

Willing to work in the IT support field. Interested in Linux / Network Technical support job Must have Linux, Red hat or Cisco certification.

Candidates must be from 2023 YOP batch only.

Local candidates are only preferred from Navi Mumbai location.  

If your profile meets the above requirement, kindly share your resume at swarupa.s1@tataelxsi.co.in with the Subject Line - SIS PS Requirement_Navi Mumbai