๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
const int MAXN = 1e5 + 5;
class SegmentTree {
private:
vector<int> tree, lazy;
int n;
void build(int node, int start, int end) {
if (start == end) {
tree[node] = 0;
return;
}
int mid = (start + end) / 2;
build(2 * node, start, mid);
build(2 * node + 1, mid + 1, end);
tree[node] = max(tree[2 * node], tree[2 * node + 1]);
}
void push(int node, int start, int end) {
if (lazy[node] != 0) {
tree[node] += lazy[node];
if (start != end) {
lazy[2 * node] += lazy[node];
lazy[2 * node + 1] += lazy[node];
}
lazy[node] = 0;
}
}
void update(int node, int start, int end, int l, int r, int val) {
push(node, start, end);
if (start > r || end < l) return;
if (l <= start && end <= r) {
lazy[node] += val;
push(node, start, end);
return;
}
int mid = (start + end) / 2;
update(2 * node, start, mid, l, r, val);
update(2 * node + 1, mid + 1, end, l, r, val);
tree[node] = max(tree[2 * node], tree[2 * node + 1]);
}
pair<int, int> query(int node, int start, int end, int l, int r) {
push(node, start, end);
if (start > r || end < l) return {-1, -1};
if (l <= start && end <= r) return {tree[node], start};
int mid = (start + end) / 2;
pair<int, int> left = query(2 * node, start, mid, l, r);
pair<int, int> right = query(2 * node + 1, mid + 1, end, l, r);
if (left.first >= right.first) return left;
return right;
}
public:
SegmentTree(int size) : n(size) {
tree.resize(4 * n);
lazy.resize(4 * n);
build(1, 0, n - 1);
}
void update(int l, int r, int val) {
update(1, 0, n - 1, l, r, val);
}
pair<int, int> query(int l, int r) {
return query(1, 0, n - 1, l, r);
}
};
void solve(int N, int Q, vector<vector<int>>& queries) {
SegmentTree st(N + 1);
for (const auto& query : queries) {
int type = query[0];
if (type == 1 || type == 2) {
int L = query[1], R = query[2];
st.update(L, R, 1);
} else if (type == 3) {
int C = query[1];
pair<int, int> result = st.query(C, N);
cout << result.second << '\n';
}
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin >> T;
while (T--) {
int N, Q;
cin >> N >> Q;
vector<vector<int>> queries(Q);
for (int i = 0; i < Q; ++i) {
int type;
cin >> type;
if (type == 1 ) {
int L=1, R;
cin >> R;
queries[i] = {type, L, R};
}
else if (type == 2) {
int L, R=N;
cin >> L ;
queries[i] = {type, L, R};
}
else {
int C;
cin >> C;
queries[i] = {type, C};
}
}
solve(N, Q, queries);
}
return 0;
}
Maximum Product Sales โ
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
const int MAXN = 1e5 + 5;
class SegmentTree {
private:
vector<int> tree, lazy;
int n;
void build(int node, int start, int end) {
if (start == end) {
tree[node] = 0;
return;
}
int mid = (start + end) / 2;
build(2 * node, start, mid);
build(2 * node + 1, mid + 1, end);
tree[node] = max(tree[2 * node], tree[2 * node + 1]);
}
void push(int node, int start, int end) {
if (lazy[node] != 0) {
tree[node] += lazy[node];
if (start != end) {
lazy[2 * node] += lazy[node];
lazy[2 * node + 1] += lazy[node];
}
lazy[node] = 0;
}
}
void update(int node, int start, int end, int l, int r, int val) {
push(node, start, end);
if (start > r || end < l) return;
if (l <= start && end <= r) {
lazy[node] += val;
push(node, start, end);
return;
}
int mid = (start + end) / 2;
update(2 * node, start, mid, l, r, val);
update(2 * node + 1, mid + 1, end, l, r, val);
tree[node] = max(tree[2 * node], tree[2 * node + 1]);
}
pair<int, int> query(int node, int start, int end, int l, int r) {
push(node, start, end);
if (start > r || end < l) return {-1, -1};
if (l <= start && end <= r) return {tree[node], start};
int mid = (start + end) / 2;
pair<int, int> left = query(2 * node, start, mid, l, r);
pair<int, int> right = query(2 * node + 1, mid + 1, end, l, r);
if (left.first >= right.first) return left;
return right;
}
public:
SegmentTree(int size) : n(size) {
tree.resize(4 * n);
lazy.resize(4 * n);
build(1, 0, n - 1);
}
void update(int l, int r, int val) {
update(1, 0, n - 1, l, r, val);
}
pair<int, int> query(int l, int r) {
return query(1, 0, n - 1, l, r);
}
};
void solve(int N, int Q, vector<vector<int>>& queries) {
SegmentTree st(N + 1);
for (const auto& query : queries) {
int type = query[0];
if (type == 1 || type == 2) {
int L = query[1], R = query[2];
st.update(L, R, 1);
} else if (type == 3) {
int C = query[1];
pair<int, int> result = st.query(C, N);
cout << result.second << '\n';
}
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin >> T;
while (T--) {
int N, Q;
cin >> N >> Q;
vector<vector<int>> queries(Q);
for (int i = 0; i < Q; ++i) {
int type;
cin >> type;
if (type == 1 ) {
int L=1, R;
cin >> R;
queries[i] = {type, L, R};
}
else if (type == 2) {
int L, R=N;
cin >> L ;
queries[i] = {type, L, R};
}
else {
int C;
cin >> C;
queries[i] = {type, C};
}
}
solve(N, Q, queries);
}
return 0;
}
Maximum Product Sales โ
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Morgan Stanley
Role: Technology Spring Analyst Program (Intern)
Batch eligible: 2025 grads only
Duration: 6 months
Apply: https://www.morganstanley.com/careers/students-graduates/opportunities/17980
Role: Technology Spring Analyst Program (Intern)
Batch eligible: 2025 grads only
Duration: 6 months
Apply: https://www.morganstanley.com/careers/students-graduates/opportunities/17980
Morgan Stanley
Careers Opportunity Details | Morgan Stanley
Learn more about this job opportunity at Morgan Stanley, including a job description, where this opportunity is located, how to apply, the team and more.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Morgan Stanley
Role: Technology Summer Analyst Program (Intern)
Batch eligible: 2026 grads only
Duration: 2 months
Apply: https://www.morganstanley.com/careers/students-graduates/opportunities/17979
Role: Technology Summer Analyst Program (Intern)
Batch eligible: 2026 grads only
Duration: 2 months
Apply: https://www.morganstanley.com/careers/students-graduates/opportunities/17979
Morgan Stanley
Careers Opportunity Details | Morgan Stanley
Learn more about this job opportunity at Morgan Stanley, including a job description, where this opportunity is located, how to apply, the team and more.
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
public class Solution {
public static int countOfElement(int[] listInput1, int[] listInput2) {
HashSet<Integer> set1 = new HashSet<>();
HashSet<Integer> set2 = new HashSet<>();
for (int num : listInput1) {
set1.add(num);
}
for (int num : listInput2) {
set2.add(num);
}
int count = 0;
for (int num : listInput1) {
if (!set2.contains(num)) {
count++;
}
}
for (int num : listInput2) {
if (!set1.contains(num)) {
count++;
}
}
return count;
}
}
public static int countOfElement(int[] listInput1, int[] listInput2) {
HashSet<Integer> set1 = new HashSet<>();
HashSet<Integer> set2 = new HashSet<>();
for (int num : listInput1) {
set1.add(num);
}
for (int num : listInput2) {
set2.add(num);
}
int count = 0;
for (int num : listInput1) {
if (!set2.contains(num)) {
count++;
}
}
for (int num : listInput2) {
if (!set1.contains(num)) {
count++;
}
}
return count;
}
}
class UserMainCode(object):
@classmethod
def qualifyingScore(cls, total_scores, num_top_scores, scores, weights):
weighted_scores = [score -weight for score, weight in zip(scores, weights)]
weighted_scores.sort(reverse=True)
top_scores_sum = sum(weighted_scores[:num_top_scores])
if top_scores_sum >= 35:
return f"Qualified {top_scores_sum}"
else:
return f"Disqualified {top_scores_sum}"
Qualifying Score โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Money Conversion โ
class UserMainCode(object):
@classmethod
def hikeTrial(cls, input1):
mod = 10000007
input1 = input1.upper()
n, m = input1.split()
n = int(n)
multi = {'D': 70, 'P': 100, 'Y': 10}
result = (n * multi[m]) % mod
return result
Money Conversion โ
Optum
@classmethod
def hikeTrial(cls, input1):
mod = 10000007
input1 = input1.upper()
n, m = input1.split()
n = int(n)
multi = {'D': 70, 'P': 100, 'Y': 10}
result = (n * multi[m]) % mod
return result
Money Conversion โ
Optum
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int ss(int a, vector<int>& b, int c, int s) {
sort(b.begin(), b.end());
int count = 0;
for (int i = 0; i < a; ++i) {
int current_capacity = b[i];
int low = c - current_capacity;
int high = s - current_capacity;
auto left_index = lower_bound(b.begin() + i + 1, b.end(), low);
auto right_index = upper_bound(b.begin() + i + 1, b.end(), high);
// Count valid pairs
count += distance(left_index, right_index);
}
return count;
}
int main() {
int a;
cin >> a;
vector<int> b(a);
for (int i = 0; i < a; ++i) {
cin >> b[i];
}
int c, s;
cin >> c >> s;
cout << ss(a, b, c, s) << endl;
return 0;
}
MS electic powerโ
Morgan Stanley
๐1
#include <vector>
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
class node {
public:
long long ind;
char c;
long long t;
node() {}
node(long long ind, char c, long long t) {
this->ind = ind;
this->c = c;
this->t = t;
}
};
bool cmp(const node &a, const node &b) {
return a.ind < b.ind;
}
vector<string> fun(int n, vector<pair<int, char>> messages) {
vector<node> v(n);
for (int i = 0; i < n; i++) {
long long ind = messages[i].first;
char c = messages[i].second;
long long t = i;
node temp(ind, c, t);
v[i] = temp;
}
sort(v.begin(), v.end(), cmp);
vector<pair<long long, string>> check;
vector<string> ans;
for (int i = 0; i < n; i++) {
if (v[i].c == '*') {
int j = i + 1;
while (j < n && v[j].c != '*' && v[j - 1].ind + 1 == v[j].ind) j++;
if (j < n && v[j].c == '*') {
long long mx = 0;
string temp = "";
for (int k = i + 1; k < j; k++) temp.push_back(v[k].c);
for (int k = i; k <= j; k++) mx = max(mx, v[k].t);
check.push_back({mx, temp});
}
}
}
sort(check.begin(), check.end(), [](const pair<long long, string> &a, const pair<long long, string> &b) {
return a.first > b.first;
});
for (const auto &entry : check) ans.push_back(entry.second);
return ans;
}
int main() {
vector<pair<int, char>> in = {{693232583, '*'}, {1, '*'}, {2, 'a'}, {693232585, '*'}, {3, '*'}, {693232584, 'w'}};
int n = in.size();
vector<string> result = fun(n, in);
for (const string &str : result) {
cout << str << endl;
}
return 0;
}
Message passing โ
Morgan Stanley
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Times internet is hiring software engineer
Exp : 0-1 years
Link : https://www.linkedin.com/feed/update/urn:li:activity:7239244367142469634
Exp : 0-1 years
Link : https://www.linkedin.com/feed/update/urn:li:activity:7239244367142469634
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Idea Forage is hiring Engineer
For 2022, 2023, 2024 grads
Location: Bangalore
https://app.webbtree.com/company/ideaforge/jobs/engineer-i-e569b3?utm_campaign=linkedin_ll_jobs_apply&utm_source=linkedin_ll&utm_medium=organic
For 2022, 2023, 2024 grads
Location: Bangalore
https://app.webbtree.com/company/ideaforge/jobs/engineer-i-e569b3?utm_campaign=linkedin_ll_jobs_apply&utm_source=linkedin_ll&utm_medium=organic
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Infoane Technologies Pvt Ltd on LinkedIn: #hiring #freshers #eligibility #apply #ece #cse #it #mca #academics #bscโฆ | 287 comments
Hello everyone,
We are currently #hiring #freshers. Please review the following #eligibility criteria and #apply through the following link:โฆ | 287 comments on LinkedIn
We are currently #hiring #freshers. Please review the following #eligibility criteria and #apply through the following link:โฆ | 287 comments on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Hiring for AI/ML Traniee Engineer
Experience: 0 - 2 years
Batch: 2022, 2023, 2024
Qualification: Any Degree
๐ปApply: https://forms.office.com/pages/responsepage.aspx?id=w4Nvcb16oUKG0uAgf0qpgdMje2z1MalJpIkCrESiIElUMjJWTjlYMUdBSE9FMFYyRkxSVTZaMUdRSi4u
Experience: 0 - 2 years
Batch: 2022, 2023, 2024
Qualification: Any Degree
๐ปApply: https://forms.office.com/pages/responsepage.aspx?id=w4Nvcb16oUKG0uAgf0qpgdMje2z1MalJpIkCrESiIElUMjJWTjlYMUdBSE9FMFYyRkxSVTZaMUdRSi4u
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
int minSideJumps(vector<int>& obstacles) {
const int inf = 1 << 30;
vector<int> f(3, inf);
f[1] = 0;
for (int i = 0; i < obstacles.size(); ++i) {
vector<int> new_f(3, inf);
for (int j = 0; j < 3; ++j) {
if (obstacles[i] != j + 1) {
new_f[j] = min(f[j], min({f[(j + 1) % 3], f[(j + 2) % 3]}) + 1);
}
}
f = new_f;
}
return min({f[0], f[1], f[2]});
}
};
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
https://docs.google.com/forms/d/e/1FAIpQLSeLlhXegzo-BseQ_4guEmwOuQJXvDLUSpdKHbUfRmFVVzz_bg/viewform
Testing Internship @ Jnet Technologies
Jnet technologies has an open position for Automation testing internship for 6 months in Hyderabad location.
Testing Internship @ Jnet Technologies
Jnet technologies has an open position for Automation testing internship for 6 months in Hyderabad location.
#include <bits/stdc++.h>
using namespace std;
long long getMinimumTotalCost(vector<int>& weights, int k) {
vector<int> adjSums;
int n = weights.size();
for (int i = 0; i < n - 1; i++) {
adjSums.push_back(weights[i] + weights[i + 1]);
}
sort(adjSums.begin(), adjSums.end());
long long minCost = weights[0] + weights[n - 1];
for (int i = 0; i < k - 1; i++) {
minCost += adjSums[i];
}
return minCost;
}