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 โ
{
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;
}
#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";
}
}
#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;
}
#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
#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 โ
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
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
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
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
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
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
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
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
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Edveon Tech Hiring Design Verification Engineer
Location : Chennai
Batch : 2021
https://docs.google.com/forms/d/e/1FAIpQLScmMUBudAbUG9AQHESb9uEarDnwnaSnlywdi3Egtd9-J5OP_w/viewform
Location : Chennai
Batch : 2021
https://docs.google.com/forms/d/e/1FAIpQLScmMUBudAbUG9AQHESb9uEarDnwnaSnlywdi3Egtd9-J5OP_w/viewform
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Thinkitive hiring Trainee software engineer
Batch : 2020-2022
https://www.thinkitive.com/company/career-freshers.html
Batch : 2020-2022
https://www.thinkitive.com/company/career-freshers.html
Thinkitive Technologies
Current Open Opportunities - Freshers | Thinkitive
Start your career as a fresher with Thinkitive, India's leading IT company.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Talent Systems
Tech Fresher Program (2024-2025)
Talent Systems - Tech Freshers Program
Please fill in all the necessary information in this form in order to successfully submit your application. You will be required to present the original documents supporting the information shared here, for the selectionโฆ
Please fill in all the necessary information in this form in order to successfully submit your application. You will be required to present the original documents supporting the information shared here, for the selectionโฆ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
One Globe Hiring only 2022/2023 Batch
https://www.linkedin.com/jobs/view/3834859418/?original_referer=https%3A%2F%2Fwww.youtube.com%2F
https://www.linkedin.com/jobs/view/3834859418/?original_referer=https%3A%2F%2Fwww.youtube.com%2F
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
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
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
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Symphonyai hiring internship Data Scientist
Only 2024 Batch
https://jobs.symphonyai.com/jobs/1626/job
Only 2024 Batch
https://jobs.symphonyai.com/jobs/1626/job
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Cyntexa hiring Associate Software Developer
Batch :2024
Location : Jaipur
https://cyntexa.com/careers/associate-software-developer/?v=linkedin
Batch :2024
Location : Jaipur
https://cyntexa.com/careers/associate-software-developer/?v=linkedin
Cyntexa
Job Position For Associate Software Developer at Cyntexa
Here is your journey towards becoming a Associate Software Developer. Check out the job roles and responsibilities.
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Zenskar is Hiring for Multiple Roles :
- Frontend Developer Intern
Apply Link -
https://zenskar.zohorecruit.in/jobs/Careers/91330000001732034/Frontend-developer-Intern
- Backend Developer Intern
Apply Link -
https://zenskar.zohorecruit.in/jobs/Careers/91330000000556984/Backend-Engineer---Intern
- DevOps Developer Intern
Apply Link -
https://zenskar.zohorecruit.in/jobs/Careers/91330000002102579/DevOps-Intern
- Frontend Developer Intern
Apply Link -
https://zenskar.zohorecruit.in/jobs/Careers/91330000001732034/Frontend-developer-Intern
- Backend Developer Intern
Apply Link -
https://zenskar.zohorecruit.in/jobs/Careers/91330000000556984/Backend-Engineer---Intern
- DevOps Developer Intern
Apply Link -
https://zenskar.zohorecruit.in/jobs/Careers/91330000002102579/DevOps-Intern
Zenskar
Zenskar - Frontend developer Intern - Remote Job
Zenskar This is a remote position. job opening |
โค1