#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
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
https://www.linkedin.com/posts/priyanshu-panwar_samsung-srib-job-activity-6947446398439014400-FfGC?utm_source=linkedin_share&utm_medium=android_app
If want they go and ask for referral
If want they go and ask for referral
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Publicis Sapient Hackathon
Batch eligible: 2023 and 2024 passouts
Round 1: Online Quiz Round 2: Online Coding Challenge Round 3: Jumpstart
Apply Link:
https://lnkd.in/dc6PDYwH
Note : Last day of Registration is Ist July, 2022
Batch eligible: 2023 and 2024 passouts
Round 1: Online Quiz Round 2: Online Coding Challenge Round 3: Jumpstart
Apply Link:
https://lnkd.in/dc6PDYwH
Note : Last day of Registration is Ist July, 2022
Unstop
Jumpstart by Publicis Sapient! | 2022 // Unstop (formerly Dare2Compete)
Jumpstart a hackathons by Publicis Sapient open to Engineering Students, Undergraduate, Postgraduate Apply online before 2022-07-02 10:00:27! | 2022
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Only for those who had given TCS NQT in the past.
Hitachi Vantara
Role: Associate
Batch eligible: 2022 passouts only
CTC: 5LPA (including 5% variable pay)
Link: https://learning.tcsionhub.in/jobs/HITACHI-VANTARA-INDIA-PRIVATE-LIMITED/Associate-2434/
Hitachi Vantara
Role: Associate
Batch eligible: 2022 passouts only
CTC: 5LPA (including 5% variable pay)
Link: https://learning.tcsionhub.in/jobs/HITACHI-VANTARA-INDIA-PRIVATE-LIMITED/Associate-2434/
learning.tcsionhub.in
Associate
We are looking for young, energetic, and dynamic candidates who have great passion for technology. The candidates should be extremely good at coding and...
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
L&T Technology Services
Batch eligible: 2021 and 2022 passouts
(Only Aerospace and Mechanical passouts)
Apply Link: https://docs.google.com/forms/d/e/1FAIpQLSdSohdaRyZdm6iVIfLzjqaknRpSe09XJB192oKtp4MBb9k6QA/viewform
Share this opportunity among your friends who are from Aerospace and Mechanical branch.
#HelpEveryone
Batch eligible: 2021 and 2022 passouts
(Only Aerospace and Mechanical passouts)
Apply Link: https://docs.google.com/forms/d/e/1FAIpQLSdSohdaRyZdm6iVIfLzjqaknRpSe09XJB192oKtp4MBb9k6QA/viewform
Share this opportunity among your friends who are from Aerospace and Mechanical branch.
#HelpEveryone
Google Docs
B.Tech in Aerospace OR Mechanical
As placement for 2023 batch is coming, so what u guys want from me....
Like resume review, mock interview, interview experience or any other thing which you guys want, feel free to tell in comment, I will try to help till what I can ๐โ
Like resume review, mock interview, interview experience or any other thing which you guys want, feel free to tell in comment, I will try to help till what I can ๐โ