#include<bits/stdc++.h>
using namespace std;
vector<int> rankSongs(vector<vector<int>> pref) {
int n = pref.size();
int m = pref[0].size();
vector<vector<int>> b(m, vector<int>(m, 0));
vector<int> w(m, 0), r(m);
iota(r.begin(), r.end(), 0);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
for (int k = j + 1; k < m; k++) {
b[pref[i][j]][pref[i][k]]++;
}
}
}
for (int i = 0; i < m; i++) {
for (int j = 0; j < m; j++) {
if (i != j && (b[i][j] > b[j][i] || (b[i][j] == b[j][i] && i < j))) {
w[i]++;
}
}
}
sort(r.begin(), r.end(), [&](int i, int j) {
return w[i] > w[j] || (w[i] == w[j] && i < j);
});
return r;
}
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> p(n, vector<int>(m));
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> p[i][j];
}
}
vector<int> r = rankSongs(p);
for (int i = 0; i < m; i++) {
cout << r[i] << endl;
}
cout << endl;
return 0;
}
Songs Popularity Code
PayPal โ
using namespace std;
vector<int> rankSongs(vector<vector<int>> pref) {
int n = pref.size();
int m = pref[0].size();
vector<vector<int>> b(m, vector<int>(m, 0));
vector<int> w(m, 0), r(m);
iota(r.begin(), r.end(), 0);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
for (int k = j + 1; k < m; k++) {
b[pref[i][j]][pref[i][k]]++;
}
}
}
for (int i = 0; i < m; i++) {
for (int j = 0; j < m; j++) {
if (i != j && (b[i][j] > b[j][i] || (b[i][j] == b[j][i] && i < j))) {
w[i]++;
}
}
}
sort(r.begin(), r.end(), [&](int i, int j) {
return w[i] > w[j] || (w[i] == w[j] && i < j);
});
return r;
}
int main() {
int n, m;
cin >> n >> m;
vector<vector<int>> p(n, vector<int>(m));
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> p[i][j];
}
}
vector<int> r = rankSongs(p);
for (int i = 0; i < m; i++) {
cout << r[i] << endl;
}
cout << endl;
return 0;
}
Songs Popularity Code
PayPal โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include<bits/stdc++.h>
using namespace std;
vector<int> solve(int N, vector<int> a, int q, vector<vector<int>> queries) {
vector<int> res;
for(int i=0; i<q; i++) {
int T = queries[i][0];
int l = queries[i][1];
int r = queries[i][2];
int x = queries[i][3];
if(T == 1) {
int ans = a[l-1];
for(int j=l; j<r; j++) {
ans |= a[j];
}
res.push_back(ans);
} else {
for(int j=l-1; j<r; j++) {
a[j] ^= x;
}
}
}
return res;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
cin>>N;
vector<int> a(N);
for(int i=0; i<N; i++) {
cin>>a[i];
}
int q;
cin>>q;
vector<vector<int>> queries(q, vector<int>(4));
for(int i=0; i<q; i++) {
for(int j=0; j<4; j++) {
cin>>queries[i][j];
}
}
vector<int> res = solve(N, a, q, queries);
for(int i=0; i<res.size(); i++) {
cout<<res[i]<<" ";
}
cout<<endl;
return 0;
}
Array bitwise operationsโ
using namespace std;
vector<int> solve(int N, vector<int> a, int q, vector<vector<int>> queries) {
vector<int> res;
for(int i=0; i<q; i++) {
int T = queries[i][0];
int l = queries[i][1];
int r = queries[i][2];
int x = queries[i][3];
if(T == 1) {
int ans = a[l-1];
for(int j=l; j<r; j++) {
ans |= a[j];
}
res.push_back(ans);
} else {
for(int j=l-1; j<r; j++) {
a[j] ^= x;
}
}
}
return res;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
cin>>N;
vector<int> a(N);
for(int i=0; i<N; i++) {
cin>>a[i];
}
int q;
cin>>q;
vector<vector<int>> queries(q, vector<int>(4));
for(int i=0; i<q; i++) {
for(int j=0; j<4; j++) {
cin>>queries[i][j];
}
}
vector<int> res = solve(N, a, q, queries);
for(int i=0; i<res.size(); i++) {
cout<<res[i]<<" ";
}
cout<<endl;
return 0;
}
Array bitwise operationsโ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Alakmalak Technologies
Role: Software Developer
Batch eligible: 2023 and 2024 passouts
Apply: https://bit.ly/3H8Dxf8
Role: Software Developer
Batch eligible: 2023 and 2024 passouts
Apply: https://bit.ly/3H8Dxf8
Codingninjas
Coding Ninjas Studio Weekend Contest 107 Coding Contest- Coding Ninjas
Level up your coding skills and quickly land a job with the Coding Ninjas Studio Contests every week. Compete and see your ranking!
Game streaming service โ
E commerce โ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Coinbase
Role: Software Engineer
Batch eligible: 2022 and 2023 passouts
Apply: https://www.coinbase.com/en-gb/careers/positions/5598961?gh_jid=5598961&gh_src=20687b321us%E2%80%A6
Role: Software Engineer
Batch eligible: 2022 and 2023 passouts
Apply: https://www.coinbase.com/en-gb/careers/positions/5598961?gh_jid=5598961&gh_src=20687b321us%E2%80%A6
Coinbase
Software Engineer, Backend - International, Remote - India - Coinbase
Coinbase is a secure online platform for buying, selling, transferring, and storing cryptocurrency.
Saks subarray productโ
long long solve(vector<int>& nums, int k) {
if (k <= 1) return 0;
int n = nums.size();
long long p = 1;
int i = 0, j = 0;
long long ans = 0;
while (j < n) {
p *= nums[j];
while (i <= j && p > k) {
p /= nums[i];
i++;
}
ans += j - i + 1;
j++;
}
return ans;
}
long long solve(vector<int>& nums, int k) {
if (k <= 1) return 0;
int n = nums.size();
long long p = 1;
int i = 0, j = 0;
long long ans = 0;
while (j < n) {
p *= nums[j];
while (i <= j && p > k) {
p /= nums[i];
i++;
}
ans += j - i + 1;
j++;
}
return ans;
}
int solve(int N, int M, vector<int>& plates) {
sort(plates.begin(), plates.end());
int left = 0, right = 1e9+7;
while (left < right) {
int mid = left + (right - left + 1) / 2;
int sum = 0;
for (int i = N - 1; i >= 0 && plates[i] >= mid; i--) {
sum += plates[i] - mid;
if (sum >= M) break;
}
if (sum >= M) left = mid;
else right = mid - 1;
}
return left;
}
Thanksgiving โ
sort(plates.begin(), plates.end());
int left = 0, right = 1e9+7;
while (left < right) {
int mid = left + (right - left + 1) / 2;
int sum = 0;
for (int i = N - 1; i >= 0 && plates[i] >= mid; i--) {
sum += plates[i] - mid;
if (sum >= M) break;
}
if (sum >= M) left = mid;
else right = mid - 1;
}
return left;
}
Thanksgiving โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Alight is Hiring !!
Role: Graduate Engineer Trainee
Expected CTC: 4-8 LPA
Location: Hyderabad
Apply here: https://careers.alight.com/us/en/job/ALIGUSR26847EXTERNALENUS/Graduate-Engineer-Trainee
Role: Graduate Engineer Trainee
Expected CTC: 4-8 LPA
Location: Hyderabad
Apply here: https://careers.alight.com/us/en/job/ALIGUSR26847EXTERNALENUS/Graduate-Engineer-Trainee
Alight
Graduate Engineer Trainee in Hyderabad, Telangana, India | Infrastructure Services at Alight
Apply for Graduate Engineer Trainee job with Alight in Hyderabad, Telangana, India. Infrastructure Services at Alight
โค2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Lolly.com is Hiring !!
Role: Python Developer
Expected CTC: 6-15 LPA
Apply here: https://linkedin.com/jobs/view/3796395323/
Role: Python Developer
Expected CTC: 6-15 LPA
Apply here: https://linkedin.com/jobs/view/3796395323/
Linkedin
Lolly.com hiring Python Developer in Bengaluru, Karnataka, India | LinkedIn
Posted 2:30:47 PM. CTC 6-15 LPACompany DescriptionLolly.com is a unified Influencer Marketplace that powers brandsโฆSee this and similar jobs on LinkedIn.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company - HITACHI
Role - R&D Engineer
Batch - 2023 , 2024
Exp CTC - 15 lpa
Location - Bengaluru
Link - https://www.hitachienergy.com/careers/open-jobs/details/JID3-60485
Role - R&D Engineer
Batch - 2023 , 2024
Exp CTC - 15 lpa
Location - Bengaluru
Link - https://www.hitachienergy.com/careers/open-jobs/details/JID3-60485
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Medpace, Inc. is Hiring !!
Role: Software Engineer
Experience: Fresher
Apply here: https://careers.medpace.com/jobs/8753
Role: Software Engineer
Experience: Fresher
Apply here: https://careers.medpace.com/jobs/8753
Software/Research Engineer - Core Laboratory in Navi Mumbai, India | Medpace, Inc.
Medpace, Inc. is hiring a Software/Research Engineer - Core Laboratory in Navi Mumbai, India. Review all of the job details and apply today!
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Postman is Hiring !!
Role: SDE Intern for 6 Months
Batch: 2024
Expected Stipend: 50k per month
Apply here- https://www.postman.com/company/careers/software-engineer-intern-5842012003/
Role: SDE Intern for 6 Months
Batch: 2024
Expected Stipend: 50k per month
Apply here- https://www.postman.com/company/careers/software-engineer-intern-5842012003/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Airblack is hiring SDE Interns
For 2024/2023 Grads
Duration: 6 months
https://www.linkedin.com/posts/suyash-agrawal-25204a131_hiring-hiringdevelopers-fullstackdevelopment-activity-7150420023948234752-z3SE?utm_source=share&utm_medium=member_android
For 2024/2023 Grads
Duration: 6 months
https://www.linkedin.com/posts/suyash-agrawal-25204a131_hiring-hiringdevelopers-fullstackdevelopment-activity-7150420023948234752-z3SE?utm_source=share&utm_medium=member_android
Linkedin
Suyash Agrawal on LinkedIn: #hiring #hiringdevelopers #fullstackdevelopment #developercommunityโฆ | 133 comments
I am looking to hire full-stack development interns for a few projects. You will get to work on cool features using the latest technologies for a community ofโฆ | 133 comments on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company - IntelliFill Tech Pvt Ltd
Role - Software Engineer Internship
Batch - 2023/2024/2025
Apply Link - https://unstop.com/o/o0V4HyK?lb=cdmoBrn&utm_medium=Share&utm_source=shortUrl
Role - Software Engineer Internship
Batch - 2023/2024/2025
Apply Link - https://unstop.com/o/o0V4HyK?lb=cdmoBrn&utm_medium=Share&utm_source=shortUrl
Unstop
Software Engineer Intern by IntelliFill Tech Pvt Ltd! | 2024 // Unstop
Software Engineer Intern a jobs by IntelliFill Tech Pvt Ltd open to All Apply online before 2024-01-19 20:00:00! | 2024