๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
void dfs(int node, int parent, const vector<vector<int>>& adj, vector<int>& subtree_sum, vector<bool>& visited) { visited[node] = true; subtree_sum[node] = node + 1; for (int neighbor : adj[node]) { if (neighbor != parent && !visited[neighbor])โฆ
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <tuple>
using namespace std;
// Directions for moving in the grid
const int dx[] = {-1, 1, 0, 0};
const int dy[] = {0, 0, -1, 1};
int getMaxDistance(int w, int h, const vector<pair<int, int>>& buildings) {
vector<vector<int>> grid(h, vector<int>(w, INT_MAX));
queue<tuple<int, int, int>> q;
for (const auto& building : buildings) {
int x = building.first, y = building.second;
grid[y][x] = 0;
q.push({x, y, 0});
}
while (!q.empty()) {
auto [x, y, d] = q.front();
q.pop();
for (int i = 0; i < 4; ++i) {
int nx = x + dx[i];
int ny = y + dy[i];
if (nx >= 0 && nx < w && ny >= 0 && ny < h && grid[ny][nx] > d + 1) {
grid[ny][nx] = d + 1;
q.push({nx, ny, d + 1});
}
}
}
int maxDistance = 0;
for (const auto& row : grid) {
for (int distance : row) {
maxDistance = max(maxDistance, distance);
}
}
return maxDistance;
}
int optimalBuildingPlacement(int w, int h, int n) {
vector<pair<int, int>> allPositions;
for (int x = 0; x < w; ++x) {
for (int y = 0; y < h; ++y) {
allPositions.emplace_back(x, y);
}
}
int minMaxDistance = INT_MAX;
vector<pair<int, int>> combination;
vector<bool> v(allPositions.size(), false);
fill(v.begin(), v.begin() + n, true);
do {
combination.clear();
for (size_t i = 0; i < allPositions.size(); ++i) {
if (v[i]) {
combination.push_back(allPositions[i]);
}
}
int maxDistance = getMaxDistance(w, h, combination);
minMaxDistance = min(minMaxDistance, maxDistance);
} while (prev_permutation(v.begin(), v.end()));
return minMaxDistance;
}
Build offices โ
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <tuple>
using namespace std;
// Directions for moving in the grid
const int dx[] = {-1, 1, 0, 0};
const int dy[] = {0, 0, -1, 1};
int getMaxDistance(int w, int h, const vector<pair<int, int>>& buildings) {
vector<vector<int>> grid(h, vector<int>(w, INT_MAX));
queue<tuple<int, int, int>> q;
for (const auto& building : buildings) {
int x = building.first, y = building.second;
grid[y][x] = 0;
q.push({x, y, 0});
}
while (!q.empty()) {
auto [x, y, d] = q.front();
q.pop();
for (int i = 0; i < 4; ++i) {
int nx = x + dx[i];
int ny = y + dy[i];
if (nx >= 0 && nx < w && ny >= 0 && ny < h && grid[ny][nx] > d + 1) {
grid[ny][nx] = d + 1;
q.push({nx, ny, d + 1});
}
}
}
int maxDistance = 0;
for (const auto& row : grid) {
for (int distance : row) {
maxDistance = max(maxDistance, distance);
}
}
return maxDistance;
}
int optimalBuildingPlacement(int w, int h, int n) {
vector<pair<int, int>> allPositions;
for (int x = 0; x < w; ++x) {
for (int y = 0; y < h; ++y) {
allPositions.emplace_back(x, y);
}
}
int minMaxDistance = INT_MAX;
vector<pair<int, int>> combination;
vector<bool> v(allPositions.size(), false);
fill(v.begin(), v.begin() + n, true);
do {
combination.clear();
for (size_t i = 0; i < allPositions.size(); ++i) {
if (v[i]) {
combination.push_back(allPositions[i]);
}
}
int maxDistance = getMaxDistance(w, h, combination);
minMaxDistance = min(minMaxDistance, maxDistance);
} while (prev_permutation(v.begin(), v.end()));
return minMaxDistance;
}
Build offices โ
import math
from collections import Counter
def solve(n, chars):
if n == 1:
return 1
ans = Counter(chars)
a = [freq for freq in ans.values() if freq > 0]
if len(a) == 1:
return a[0]
sum_gcd = 0
len_freqs = len(a)
for i in range(len_freqs):
for j in range(i + 1, len_freqs):
sum_gcd += math.gcd(a[i], a[j])
return sum_gcd
Phone pe โ
from collections import Counter
def solve(n, chars):
if n == 1:
return 1
ans = Counter(chars)
a = [freq for freq in ans.values() if freq > 0]
if len(a) == 1:
return a[0]
sum_gcd = 0
len_freqs = len(a)
for i in range(len_freqs):
for j in range(i + 1, len_freqs):
sum_gcd += math.gcd(a[i], a[j])
return sum_gcd
Phone pe โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Pitney Bowes is hiring QA Interns
2025/2024/2023 passouts can apply
https://careers.pitneybowes.com/global/en/job/R18422/Intern-QA?rx_job=R18422&rx_medium=post&rx_paid=0&rx_r=none&rx_source=linkedinll&rx_ts=20240718T021606Z&rx_viewer=f31609e0b41311ee90450bb95a3380bef7666ebed64d4e95aade908439480d1d
2025/2024/2023 passouts can apply
https://careers.pitneybowes.com/global/en/job/R18422/Intern-QA?rx_job=R18422&rx_medium=post&rx_paid=0&rx_r=none&rx_source=linkedinll&rx_ts=20240718T021606Z&rx_viewer=f31609e0b41311ee90450bb95a3380bef7666ebed64d4e95aade908439480d1d
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
intern at take you forward https://www.linkedin.com/posts/takeuforward_internship-drive-tomorrow-at-8-pm-if-you-activity-7220012171378798592-zXqN?utm_source=share&utm_medium=member_desktop
Linkedin
Join our DSA drive tomorrow at 8 PM | takeUforward posted on the topic | LinkedIn
๐จInternship drive tomorrow at 8 PM
If you are someone who is into problem solving, you might enjoy this one as it helps you learn/prepare while getting paid.โฆ | 223 comments on LinkedIn
If you are someone who is into problem solving, you might enjoy this one as it helps you learn/prepare while getting paid.โฆ | 223 comments on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
NoScrubs is hiring Full-Stack Engineer Intern (previous intern experience is must)
For 2024, 2025, 2026 grads
Location: Remote
Stipend - 40K per month
Apply - https://wellfound.com/jobs/3062383-full-stack-engineer-intern
For 2024, 2025, 2026 grads
Location: Remote
Stipend - 40K per month
Apply - https://wellfound.com/jobs/3062383-full-stack-engineer-intern
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
https://forms.office.com/pages/responsepage.aspx?id=W8FT8jyv2EaRBTCyeq83uQqH6OaTWbdFvQLgqAudlD5URE1JVExNWE1QUjhDSjdOWUdUU0xFTEEwQy4u
iMocha Hiring Prompt Engineering Intern
Students pursuing or completed B.Sc/BCA/MCA/BE/B.Tech.
- Only freshers can apply.
- Proficiency in programming languages and technical skills.
- Excellent written and verbal communication skills.
- Ability to collaborate effectively within a team and across departments.
- Eagerness to learn and contribute to the development of AI-driven solutions.
Pay range: 7K-12K INR per month
iMocha Hiring Prompt Engineering Intern
Students pursuing or completed B.Sc/BCA/MCA/BE/B.Tech.
- Only freshers can apply.
- Proficiency in programming languages and technical skills.
- Excellent written and verbal communication skills.
- Ability to collaborate effectively within a team and across departments.
- Eagerness to learn and contribute to the development of AI-driven solutions.
Pay range: 7K-12K INR per month
Office
Please fill out this form
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Walmart | Sparkathon
Eligibility: 2025 and 2026 grads
Chance to get a software development internship at Walmart.
https://walmart.converge.tech/content/converge/en_in/sparkathon.html
Eligibility: 2025 and 2026 grads
Chance to get a software development internship at Walmart.
https://walmart.converge.tech/content/converge/en_in/sparkathon.html
Sparkathon: Open innovation challenge for Indian students
Hack your way through complex retail problems using deep tech and build a culture that emphasizes product innovation and entrepreneurial vision.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
JUSPAY is hiring for React Developer (0-3 years)
Expected Salary: 15-25 LPA
Apply here:
https://linkedin.com/jobs/view/3977724060/
Expected Salary: 15-25 LPA
Apply here:
https://linkedin.com/jobs/view/3977724060/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐FlytBase is hiring for Solutions Engineer Intern
Apply here:
https://docs.google.com/forms/d/e/1FAIpQLSenW1WuhUb_UbXPmi9tPFf9yPR7FPeERoqYQ39SN_vY21sjaA/viewform
Apply here:
https://docs.google.com/forms/d/e/1FAIpQLSenW1WuhUb_UbXPmi9tPFf9yPR7FPeERoqYQ39SN_vY21sjaA/viewform
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
SHRIRAM GENERAL Insurance is hiring for Associate Software Engineer - remote
Apply here:
https://linkedin.com/jobs/view/3978327906/?alternateChannel=search
Apply here:
https://linkedin.com/jobs/view/3978327906/?alternateChannel=search
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
NEWME is hiring for React Native Developer (0-2 years)
Apply here:
https://linkedin.com/jobs/view/3976005501/?alternateChannel=search
Apply here:
https://linkedin.com/jobs/view/3976005501/?alternateChannel=search
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Amazon is hiring for SDE l and SDE ll roles
SDE l : 2023/2022/2021 batches and below
SDE ll : 3+ year experience
Send resume : shivg7706@gmail.com
Subject Format of mail : Name | Company | Experience | Preferred Location | SDE l / SDE ll
Resume file name : YOURFULLNAME.pdf
SDE l : 2023/2022/2021 batches and below
SDE ll : 3+ year experience
Send resume : shivg7706@gmail.com
Subject Format of mail : Name | Company | Experience | Preferred Location | SDE l / SDE ll
Resume file name : YOURFULLNAME.pdf
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Always dreamed of studying at IIT? ๐
Now you can, without JEE!
IIT Guwahati presents a unique Credit Linked Program in Computer Science where you can earn 24 program credits (equivalent to a minor degree) with live modules and rigorous assessments by IIT professors. ๐ฅ๏ธ๐
Gain in-depth knowledge in Programming, Math for CS, Data Structures, Algorithms, and more.
This is your second chance to experience IIT-quality education! ๐
Enrol now and join the prestigious IIT ecosystem without the stress of an entrance exam ๐
Apply now, Limited Seats Available: https://epcw.short.gy/AC_IITG_TG
Now you can, without JEE!
IIT Guwahati presents a unique Credit Linked Program in Computer Science where you can earn 24 program credits (equivalent to a minor degree) with live modules and rigorous assessments by IIT professors. ๐ฅ๏ธ๐
Gain in-depth knowledge in Programming, Math for CS, Data Structures, Algorithms, and more.
This is your second chance to experience IIT-quality education! ๐
Enrol now and join the prestigious IIT ecosystem without the stress of an entrance exam ๐
Apply now, Limited Seats Available: https://epcw.short.gy/AC_IITG_TG
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)
Urgent hiring Bulk Fresher and Interns- PAN -2024
Post Name - Multiple Positions and HR
non IT Freshers & Experience.
Interested Apply here:-https://lnkd.in/gerxxYci
Remote and WFH both options are available.
( Preferably Experience)
- Laptop and welcome kit will provided.
-5 Days working
Qualification - Any Degree and 12 th passout .
Salary - 3.5 LPA to 6 LPA
Post Name - Multiple Positions and HR
non IT Freshers & Experience.
Interested Apply here:-https://lnkd.in/gerxxYci
Remote and WFH both options are available.
( Preferably Experience)
- Laptop and welcome kit will provided.
-5 Days working
Qualification - Any Degree and 12 th passout .
Salary - 3.5 LPA to 6 LPA
lnkd.in
LinkedIn
This link will take you to a page thatโs not on LinkedIn