๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.61K photos
3 videos
95 files
10.6K 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 <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)โœ…
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
๐Ÿ‘1
Remove things that don't ๐‚๐Ž๐๐“๐‘๐ˆ๐๐”๐“๐„ to your ๐†๐‘๐Ž๐–๐“๐‡๐Ÿ˜Šโค๏ธ

# A motivational quote to start your day with ๐Ÿ˜Š
โค2