Kingdom Connect (Amazon)
Python 3โ
Python 3โ
Amazon web services โ
(Python 3)
(Python 3)
Good String
Kingdom connection ๐ฅ
Kingdom connection ๐ฅ
#include <bits/stdc++.h>
using namespace std;
void rem(string str,pair<int,int>p,unordered_map<int,int>map,int &ans){
int prev=0;
unordered_map<char,int>c;
for(int i=p.first-1;i<p.second;i++)c[str.at(i)]++;
priority_queue<pair<int,char>,vector<pair<int,char>>,greater<pair<int,char>>>pq;
for(int i=p.first-1;i<p.second;i++)pq.push({map[i+1],str.at(i)});
while(!pq.empty()){
pair<int,char>top=pq.top();
pq.pop();
if(c[top.second]>1){
c[top.second]--;
ans+=(top.first-prev);
prev=top.first;
}
}
}
int main() {
int t;
cin>>t;
while(t--){
int n,q,ans=0;
cin>>n>>q;
string str;
cin>>str;
unordered_map<int,int>map;
for(int i=1;i<=n;i++){
int v;
cin>>v;
map[v]=i;
}
vector<pair<int,int>>p,m;
for(int i=0;i<q;i++){
int u,v;
cin>>u>>v;
p.push_back({u,v});
}
sort(p.begin(),p.end());
m.push_back(p.at(0));
for(int i=1;i<q;i++){
if(p.at(i).first>m.back().second)m.push_back(p.at(i));
else{
pair<int,int>pt=m.back();
m.pop_back();
m.push_back({pt.first,max(p.at(i).second,pt.second)});
}
}
for(int i=0;i<m.size();i++){
rem(str,m.at(i),map,ans);
}
cout<<ans<<endl;
}
}
Good String (Amazon)
C++(14)โ
using namespace std;
void rem(string str,pair<int,int>p,unordered_map<int,int>map,int &ans){
int prev=0;
unordered_map<char,int>c;
for(int i=p.first-1;i<p.second;i++)c[str.at(i)]++;
priority_queue<pair<int,char>,vector<pair<int,char>>,greater<pair<int,char>>>pq;
for(int i=p.first-1;i<p.second;i++)pq.push({map[i+1],str.at(i)});
while(!pq.empty()){
pair<int,char>top=pq.top();
pq.pop();
if(c[top.second]>1){
c[top.second]--;
ans+=(top.first-prev);
prev=top.first;
}
}
}
int main() {
int t;
cin>>t;
while(t--){
int n,q,ans=0;
cin>>n>>q;
string str;
cin>>str;
unordered_map<int,int>map;
for(int i=1;i<=n;i++){
int v;
cin>>v;
map[v]=i;
}
vector<pair<int,int>>p,m;
for(int i=0;i<q;i++){
int u,v;
cin>>u>>v;
p.push_back({u,v});
}
sort(p.begin(),p.end());
m.push_back(p.at(0));
for(int i=1;i<q;i++){
if(p.at(i).first>m.back().second)m.push_back(p.at(i));
else{
pair<int,int>pt=m.back();
m.pop_back();
m.push_back({pt.first,max(p.at(i).second,pt.second)});
}
}
for(int i=0;i<m.size();i++){
rem(str,m.at(i),map,ans);
}
cout<<ans<<endl;
}
}
Good String (Amazon)
C++(14)โ
โ๏ธGLOBANT OffCampus Driveโ๏ธ
๐ Batch - 2020 & 2021
๐ฐ CTC - 4.8LPA
๐ Link - bit.ly/3OpsboY
๐ Batch - 2020 & 2021
๐ฐ CTC - 4.8LPA
๐ Link - bit.ly/3OpsboY
match.myanatomy.in
MATCH (MyAnatomy Talent Convergence Horizon)
A Campus Recruitment Enabler, converging the Corporates, Candidates and Colleges in one single platform
๐1
MCQ KYT
1q)sass
Softwares as a service
A
2q)navigational
A
True
3q) drawback
D
Cost of computing
4q) cloud service are
B.
True.
5q)the paradgism
C
Progessive
SQL
1)in a sql primary
A
True
2)from player where
A
Whose 2nd letter
3)the agreegate function
A
True
4)name like v per t
Ends with t
B
5)order by age runs
A
Then on runs
1q)sass
Softwares as a service
A
2q)navigational
A
True
3q) drawback
D
Cost of computing
4q) cloud service are
B.
True.
5q)the paradgism
C
Progessive
SQL
1)in a sql primary
A
True
2)from player where
A
Whose 2nd letter
3)the agreegate function
A
True
4)name like v per t
Ends with t
B
5)order by age runs
A
Then on runs
๐1
Good String
C++ languageโ
(Amazon)
C++ languageโ
(Amazon)
Kingdom connection
Python 3 โ
(Amazon)
Python 3 โ
(Amazon)
Remove things that don't ๐๐๐๐๐๐๐๐๐๐ to your ๐๐๐๐๐๐๐โค๏ธ
# A motivational quote to start your day with ๐
# A motivational quote to start your day with ๐
โค2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Texas Instruments for 2022/2021/2020 passouts.
CTC : 32 Lakhs
Do send it to core ECE students! ๐
https://ti.wecreateproblems.com/
CTC : 32 Lakhs
Do send it to core ECE students! ๐
https://ti.wecreateproblems.com/
Campus Placements @ TI
Register for the Campus Placements @ TIโs hiring drive. Apply for Analog & Digital engineering roles.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐1