Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Caterpillar
Role: Associate Software Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://careers.caterpillar.com/en/jobs/job/r0000257330-associate-software-engineer/
Role: Associate Software Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://careers.caterpillar.com/en/jobs/job/r0000257330-associate-software-engineer/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: NI
Role: Software Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://pef.fa.us1.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/job/9331
Role: Software Engineer
Batch eligible: 2023 and 2024 grads
Apply: https://pef.fa.us1.oraclecloud.com/hcmUI/CandidateExperience/en/sites/CX_1/job/9331
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Awign is hiring for Product Intern
10 k per month stipend
Send resume to : anup.pohaney@awign.com
10 k per month stipend
Send resume to : anup.pohaney@awign.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐ Join Our FinTech Team : Founding Mobile Developer
Location: Gurugram
Type: Full-time position at Gurugram Office
Experience: 0-2 yrs of Experience (Freshers/Recent Graduates can also apply) (Flutter Experience Preferred but any mobile development experience will be good enough)
Qualifications: B.Tech CSE Preferred but if you have worked in FinTech earlier, that would be a bigger plus. (Btw Open to all)
Perks: Competitive compensation and ESOPs ; and an exposure to Trading & FinTech Industry like never before.
Apply Here : https://forms.gle/cW1KK2n4hsqzRvdS7
Location: Gurugram
Type: Full-time position at Gurugram Office
Experience: 0-2 yrs of Experience (Freshers/Recent Graduates can also apply) (Flutter Experience Preferred but any mobile development experience will be good enough)
Qualifications: B.Tech CSE Preferred but if you have worked in FinTech earlier, that would be a bigger plus. (Btw Open to all)
Perks: Competitive compensation and ESOPs ; and an exposure to Trading & FinTech Industry like never before.
Apply Here : https://forms.gle/cW1KK2n4hsqzRvdS7
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Check out this job at INDmoney: https://www.linkedin.com/jobs/view/3979166118
Linkedin
INDmoney hiring Product Management Intern in Gurugram, Haryana, India | LinkedIn
Posted 9:44:16 AM. Duration: 6 months
Key ResponsibilitiesAssist with Product Research: Support market research andโฆSee this and similar jobs on LinkedIn.
Key ResponsibilitiesAssist with Product Research: Support market research andโฆ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)
Mouser Electronics is hiring for Web Developer I (0-4 years)
Expected Salary: 10-20 LPA
Apply here:
https://phf.tbe.taleo.net/phf03/ats/careers/v2/viewRequisition?org=MOUSER&cws=40&rid=17859
Expected Salary: 10-20 LPA
Apply here:
https://phf.tbe.taleo.net/phf03/ats/careers/v2/viewRequisition?org=MOUSER&cws=40&rid=17859
phf.tbe.taleo.net
Hiring Web Developer I, Internet MP0600 - BANGALORE INDIA
View job details and apply now
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Scalong AI is hiring for Postgres DBA role
2024/ 2023 batch passouts eligible
Noida location
Send resume at : kajalm@ibosstech-us.com
yashikas@ibosstech-us.com
2024/ 2023 batch passouts eligible
Noida location
Send resume at : kajalm@ibosstech-us.com
yashikas@ibosstech-us.com
int mincost(vector<int> &pods,vector<int> &cost){
map<int,multiset<int>> mp;
for(int i=0;i<pods.size();i++){
mp[pods[i]].insert(cost[i]);
}
int ans = 0;
int curr = (*mp.begin()).first,sm = 0;
multiset<int> se;
while(1){
if(se.size()==0){
if(mp.lower_bound(curr) == mp.end()) break;
curr = (*mp.lower_bound(curr)).first;
}
if(mp.find(curr) != mp.end())
for(auto &x:mp[curr]){
se.insert(x);
sm += x;
}
auto it = se.end();
it--;
sm -= *it;
ans += sm;
se.erase(it);
curr++;
}
return ans;
}
Weird Pod Count โ
map<int,multiset<int>> mp;
for(int i=0;i<pods.size();i++){
mp[pods[i]].insert(cost[i]);
}
int ans = 0;
int curr = (*mp.begin()).first,sm = 0;
multiset<int> se;
while(1){
if(se.size()==0){
if(mp.lower_bound(curr) == mp.end()) break;
curr = (*mp.lower_bound(curr)).first;
}
if(mp.find(curr) != mp.end())
for(auto &x:mp[curr]){
se.insert(x);
sm += x;
}
auto it = se.end();
it--;
sm -= *it;
ans += sm;
se.erase(it);
curr++;
}
return ans;
}
Weird Pod Count โ
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool canCoverAllHouses(const vector<int>& houses, int N, int K, int P) {
int count = 0;
int i = 0;
while (i < N && count < K) {
int location = houses[i] + P;
count++;
while (i < N && houses[i] <= location + P) {
i++;
}
}
return i == N;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, K;
cin >> N >> K;
vector<int> houses(N);
for (int i = 0; i < N; ++i) {
cin >> houses[i];
}
sort(houses.begin(), houses.end());
int left = 0;
int right = houses[N-1] - houses[0];
int result = right;
while (left <= right) {
int mid = left + (right - left) / 2;
if (canCoverAllHouses(houses, N, K, mid)) {
result = mid;
right = mid - 1;
} else {
left = mid + 1;
}
}
cout << result << '\n';
return 0;
}
#include <vector>
#include <algorithm>
using namespace std;
bool canCoverAllHouses(const vector<int>& houses, int N, int K, int P) {
int count = 0;
int i = 0;
while (i < N && count < K) {
int location = houses[i] + P;
count++;
while (i < N && houses[i] <= location + P) {
i++;
}
}
return i == N;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N, K;
cin >> N >> K;
vector<int> houses(N);
for (int i = 0; i < N; ++i) {
cin >> houses[i];
}
sort(houses.begin(), houses.end());
int left = 0;
int right = houses[N-1] - houses[0];
int result = right;
while (left <= right) {
int mid = left + (right - left) / 2;
if (canCoverAllHouses(houses, N, K, mid)) {
result = mid;
right = mid - 1;
} else {
left = mid + 1;
}
}
cout << result << '\n';
return 0;
}
๐1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <bits/stdc++.h>
#define ll long long
using namespace std;
vector<ll> solve(ll n,ll m,vector<ll>&txt,vector<ll>& pat)
{
vector<ll>mask(UCHAR_MAX+1,~0);
for (ll i=0;i<m;i++)
{
mask[pat[i]]&=~(1U<<i);
}
vector<ll>result;
ll R=~1;
vector<ll>Rm(2,~1);
for (ll i=0;i<n;i++)
{
ll old=R;
R|=mask[txt[i]];
R<<=1;
ll tmp=Rm[1];
Rm[1]=(old&(Rm[1]|mask[txt[i]]))<<1;
old=tmp;
if((Rm[1]&(1U<<m))==0)
{
result.push_back(i-m+2);
}
}
return result;
}
signed main()
{
ll n,m; cin>>n>>m;
vector<ll>txt(n),pat(m);
for(ll i=0;i<n;i++) cin>>txt[i];
for(ll i=0;i<m;i++) cin>>pat[i];
auto ans=solve(n,m,txt,pat);
cout<<ans.size()<<endl;
for(auto it:ans) cout<<it<<" ";
return 0;
}
Phonepe โ
Find my file
#include <iostream>
#include <vector>
#include <unordered_set>
#include <string>
using namespace std;
bool containsDislikedDigits(int number, const unordered_set<int>& dislikedDigits) {
while (number > 0) {
if (dislikedDigits.find(number % 10) != dislikedDigits.end()) {
return true;
}
number /= 10;
}
return false;
}
int solve(int N, int k, vector<int>& d) {
unordered_set<int> dislikedDigits(d.begin(), d.end());
while (containsDislikedDigits(N, dislikedDigits)) {
++N;
}
return N;
}
int main() {
int N, k;
cin >> N >> k;
vector<int> d(k);
for (int i = 0; i < k; ++i) {
cin >> d[i];
}
int result = solve(N, k, d);
cout << result << endl;
return 0;
}
//minimum amount
Increffโ
#include <vector>
#include <unordered_set>
#include <string>
using namespace std;
bool containsDislikedDigits(int number, const unordered_set<int>& dislikedDigits) {
while (number > 0) {
if (dislikedDigits.find(number % 10) != dislikedDigits.end()) {
return true;
}
number /= 10;
}
return false;
}
int solve(int N, int k, vector<int>& d) {
unordered_set<int> dislikedDigits(d.begin(), d.end());
while (containsDislikedDigits(N, dislikedDigits)) {
++N;
}
return N;
}
int main() {
int N, k;
cin >> N >> k;
vector<int> d(k);
for (int i = 0; i < k; ++i) {
cin >> d[i];
}
int result = solve(N, k, d);
cout << result << endl;
return 0;
}
//minimum amount
Increffโ
Smallest number
Increff โ
Increff โ
def maxShared(friends_nodes, friends_from, friends_to, friends_weight):
interests = {}
for i in range(len(friends_from)):
pair = tuple(sorted([friends_from[i], friends_to[i]]))
if pair not in interests:
interests[pair] = set()
interests[pair].add(friends_weight[i])
max_shared = max(len(interests[pair]) for pair in interests)
max_pairs = [pair for pair in interests if len(interests[pair]) == max_shared]
max_product = max(pair[0] * pair[1] for pair in max_pairs)
return max_product
def canAchieve(min_attention, attention, m, k):
n = len(attention)
diff = [0] * (n + 1)
current_add = 0
workshops_used = 0
for i in range(n):
current_add += diff[i]
if attention[i] + current_add < min_attention:
increment = min_attention - (attention[i] + current_add)
workshops_used += increment
if workshops_used > m:
return False
if i + k < n:
diff[i + k] -= increment
current_add += increment
return workshops_used <= m
def maximizeMinAttention(attention, m, k):
left = min(attention)
right = max(attention) + m
while left < right:
mid = (left + right + 1) // 2
if canAchieve(mid, attention, m, k):
left = mid
else:
right = mid - 1
return left
n = len(attention)
diff = [0] * (n + 1)
current_add = 0
workshops_used = 0
for i in range(n):
current_add += diff[i]
if attention[i] + current_add < min_attention:
increment = min_attention - (attention[i] + current_add)
workshops_used += increment
if workshops_used > m:
return False
if i + k < n:
diff[i + k] -= increment
current_add += increment
return workshops_used <= m
def maximizeMinAttention(attention, m, k):
left = min(attention)
right = max(attention) + m
while left < right:
mid = (left + right + 1) // 2
if canAchieve(mid, attention, m, k):
left = mid
else:
right = mid - 1
return left
โค1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <unordered_map>
#include <string>
#include <sstream>
#include <algorithm>
#include <stdexcept>
using namespace std;
struct U {
int i;
bool a;
};
struct C {
unordered_map<int, U> u;
unordered_map<int, int> m;
void p(vector<vector<string>>& e) {
for (const auto& ev : e) {
string a = ev[0];
int t = 0;
try {
t = stoi(ev[1]);
} catch (const invalid_argument& ex) {
cerr << "Invalid timestamp: " << ev[1] << endl;
continue;
}
if (a == "MESSAGE") {
string ml = ev[2];
istringstream iss(ml);
string tk;
while (iss >> tk) {
if (tk == "ALL") {
for (auto& us : u) {
m[us.first]++;
}
} else if (tk == "HERE") {
for (auto& us : u) {
if (us.second.a) {
m[us.first]++;
}
}
} else if (tk.size() >= 3) {
try {
int id = stoi(tk.substr(2));
m[id]++;
} catch (const invalid_argument& ex) {
cerr << "Invalid user ID: " << tk.substr(2) << endl;
}
}
}
} else if (a == "OFFLINE" && ev.size() >= 3) {
string idStr = ev[2].substr(2);
if (!idStr.empty()) {
try {
int id = stoi(idStr);
if (u.find(id) != u.end()) {
u[id].a = false;
m[id]--;
m[-1]--;
if (u[id].a) {
m[-2]--;
}
}
} catch (const invalid_argument& ex) {
cerr << "Invalid user ID: " << idStr << endl;
}
}
}
}
}
vector<string> g() {
vector<string> r;
for (const auto& me : m) {
if (me.first >= 0) {
r.push_back("id" + to_string(me.first) + " - " + to_string(me.second));
}
}
sort(r.begin(), r.end());
return r;
}
};
int main() {
vector<vector<string>> e = {
{"MESSAGE", "0", "ALL id158 id42"},
{"OFFLINE", "1", "id158"},
{"MESSAGE", "2", "id158 id158"},
{"OFFLINE", "3", "id23"},
{"MESSAGE", "60", "HERE id158 id42 id23"},
{"MESSAGE", "61", "HERE"}
};
C c;
c.p(e);
vector<string> r = c.g();
for (const string& s : r) {
cout << s << endl;
}
return 0;
}
#include <vector>
#include <unordered_map>
#include <string>
#include <sstream>
#include <algorithm>
#include <stdexcept>
using namespace std;
struct U {
int i;
bool a;
};
struct C {
unordered_map<int, U> u;
unordered_map<int, int> m;
void p(vector<vector<string>>& e) {
for (const auto& ev : e) {
string a = ev[0];
int t = 0;
try {
t = stoi(ev[1]);
} catch (const invalid_argument& ex) {
cerr << "Invalid timestamp: " << ev[1] << endl;
continue;
}
if (a == "MESSAGE") {
string ml = ev[2];
istringstream iss(ml);
string tk;
while (iss >> tk) {
if (tk == "ALL") {
for (auto& us : u) {
m[us.first]++;
}
} else if (tk == "HERE") {
for (auto& us : u) {
if (us.second.a) {
m[us.first]++;
}
}
} else if (tk.size() >= 3) {
try {
int id = stoi(tk.substr(2));
m[id]++;
} catch (const invalid_argument& ex) {
cerr << "Invalid user ID: " << tk.substr(2) << endl;
}
}
}
} else if (a == "OFFLINE" && ev.size() >= 3) {
string idStr = ev[2].substr(2);
if (!idStr.empty()) {
try {
int id = stoi(idStr);
if (u.find(id) != u.end()) {
u[id].a = false;
m[id]--;
m[-1]--;
if (u[id].a) {
m[-2]--;
}
}
} catch (const invalid_argument& ex) {
cerr << "Invalid user ID: " << idStr << endl;
}
}
}
}
}
vector<string> g() {
vector<string> r;
for (const auto& me : m) {
if (me.first >= 0) {
r.push_back("id" + to_string(me.first) + " - " + to_string(me.second));
}
}
sort(r.begin(), r.end());
return r;
}
};
int main() {
vector<vector<string>> e = {
{"MESSAGE", "0", "ALL id158 id42"},
{"OFFLINE", "1", "id158"},
{"MESSAGE", "2", "id158 id158"},
{"OFFLINE", "3", "id23"},
{"MESSAGE", "60", "HERE id158 id42 id23"},
{"MESSAGE", "61", "HERE"}
};
C c;
c.p(e);
vector<string> r = c.g();
for (const string& s : r) {
cout << s << endl;
}
return 0;
}
def min_cost_to_make_strongly_connected(N, tracks):
from collections import defaultdict, deque
import heapq
def kosaraju_scc(N, adj_list, rev_adj_list):
def dfs(node, adj_list, visited, stack):
visited[node] = True
for neighbor, _ in adj_list[node]:
if not visited[neighbor]:
dfs(neighbor, adj_list, visited, stack)
stack.append(node)
def reverse_dfs(node, rev_adj_list, visited, scc):
visited[node] = True
scc.append(node)
for neighbor in rev_adj_list[node]:
if not visited[neighbor]:
reverse_dfs(neighbor, rev_adj_list, visited, scc)
stack = []
visited = [False] * (N + 1)
for i in range(1, N + 1):
if not visited[i]:
dfs(i, adj_list, visited, stack)
visited = [False] * (N + 1)
sccs = []
while stack:
node = stack.pop()
if not visited[node]:
scc = []
reverse_dfs(node, rev_adj_list, visited, scc)
sccs.append(scc)
return sccs
adj_list = defaultdict(list)
rev_adj_list = defaultdict(list)
for A, B, C in tracks:
adj_list[A].append((B, C))
rev_adj_list[B].append(A)
sccs = kosaraju_scc(N, adj_list, rev_adj_list)
node_to_scc = {}
for i, scc in enumerate(sccs):
for node in scc:
node_to_scc[node] = i
component_graph = defaultdict(list)
component_cost = {}
for A, B, C in tracks:
compA = node_to_scc[A]
compB = node_to_scc[B]
if compA != compB:
if (compA, compB) not in component_cost or component_cost[(compA, compB)] > C:
component_cost[(compA, compB)] = C
pq = []
for (u, v), cost in component_cost.items():
heapq.heappush(pq, (cost, u, v))
parent = list(range(len(sccs)))
rank = [0] * len(sccs)
def find(u):
if parent[u] != u:
parent[u] = find(parent[u])
return parent[u]
def union(u, v):
root_u = find(u)
root_v = find(v)
if root_u != root_v:
if rank[root_u] > rank[root_v]:
parent[root_v] = root_u
elif rank[root_u] < rank[root_v]:
parent[root_u] = root_v
else:
parent[root_v] = root_u
rank[root_u] += 1
min_cost = 0
edges_used = 0
while pq and edges_used < len(sccs) - 1:
cost, u, v = heapq.heappop(pq)
if find(u) != find(v):
union(u, v)
min_cost += cost
edges_used += 1
return min_cost//2
Phonepe โ
from collections import defaultdict, deque
import heapq
def kosaraju_scc(N, adj_list, rev_adj_list):
def dfs(node, adj_list, visited, stack):
visited[node] = True
for neighbor, _ in adj_list[node]:
if not visited[neighbor]:
dfs(neighbor, adj_list, visited, stack)
stack.append(node)
def reverse_dfs(node, rev_adj_list, visited, scc):
visited[node] = True
scc.append(node)
for neighbor in rev_adj_list[node]:
if not visited[neighbor]:
reverse_dfs(neighbor, rev_adj_list, visited, scc)
stack = []
visited = [False] * (N + 1)
for i in range(1, N + 1):
if not visited[i]:
dfs(i, adj_list, visited, stack)
visited = [False] * (N + 1)
sccs = []
while stack:
node = stack.pop()
if not visited[node]:
scc = []
reverse_dfs(node, rev_adj_list, visited, scc)
sccs.append(scc)
return sccs
adj_list = defaultdict(list)
rev_adj_list = defaultdict(list)
for A, B, C in tracks:
adj_list[A].append((B, C))
rev_adj_list[B].append(A)
sccs = kosaraju_scc(N, adj_list, rev_adj_list)
node_to_scc = {}
for i, scc in enumerate(sccs):
for node in scc:
node_to_scc[node] = i
component_graph = defaultdict(list)
component_cost = {}
for A, B, C in tracks:
compA = node_to_scc[A]
compB = node_to_scc[B]
if compA != compB:
if (compA, compB) not in component_cost or component_cost[(compA, compB)] > C:
component_cost[(compA, compB)] = C
pq = []
for (u, v), cost in component_cost.items():
heapq.heappush(pq, (cost, u, v))
parent = list(range(len(sccs)))
rank = [0] * len(sccs)
def find(u):
if parent[u] != u:
parent[u] = find(parent[u])
return parent[u]
def union(u, v):
root_u = find(u)
root_v = find(v)
if root_u != root_v:
if rank[root_u] > rank[root_v]:
parent[root_v] = root_u
elif rank[root_u] < rank[root_v]:
parent[root_u] = root_v
else:
parent[root_v] = root_u
rank[root_u] += 1
min_cost = 0
edges_used = 0
while pq and edges_used < len(sccs) - 1:
cost, u, v = heapq.heappop(pq)
if find(u) != find(v):
union(u, v)
min_cost += cost
edges_used += 1
return min_cost//2
Phonepe โ