๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
using namespace std;
class SegmentTree {
private:
vector<int> tree;
int size;
public:
SegmentTree(int n) {
size = 1;
while (size < n) {
size *= 2;
}
tree.assign(2 * size, 0);
}
void update(int idx, int value) {
idx += size;
tree[idx] += value;
while (idx > 1) {
idx /= 2;
tree[idx] = tree[2 * idx] + tree[2 * idx + 1];
}
}
int query(int left, int right) {
left += size;
right += size + 1;
int sum = 0;
while (left < right) {
if (left % 2 == 1) {
sum += tree[left];
left++;
}
if (right % 2 == 1) {
right--;
sum += tree[right];
}
left /= 2;
right /= 2;
}
return sum;
}
};
vector<int> solution(int numOfEmployees, int numOfQueries, vector<vector<int>>& queries) {
SegmentTree seg_tree(numOfEmployees);
vector<int> results;
for (const auto& query : queries) {
int q_type = query[0];
if (q_type == 1) {
int emp_id = query[1];
int amount = query[2];
seg_tree.update(emp_id, amount);
} else if (q_type == 2) {
int left = query[1];
int right = query[2];
results.push_back(seg_tree.query(left, right));
}
}
return results;
}
Netapp โ
#include <vector>
using namespace std;
class SegmentTree {
private:
vector<int> tree;
int size;
public:
SegmentTree(int n) {
size = 1;
while (size < n) {
size *= 2;
}
tree.assign(2 * size, 0);
}
void update(int idx, int value) {
idx += size;
tree[idx] += value;
while (idx > 1) {
idx /= 2;
tree[idx] = tree[2 * idx] + tree[2 * idx + 1];
}
}
int query(int left, int right) {
left += size;
right += size + 1;
int sum = 0;
while (left < right) {
if (left % 2 == 1) {
sum += tree[left];
left++;
}
if (right % 2 == 1) {
right--;
sum += tree[right];
}
left /= 2;
right /= 2;
}
return sum;
}
};
vector<int> solution(int numOfEmployees, int numOfQueries, vector<vector<int>>& queries) {
SegmentTree seg_tree(numOfEmployees);
vector<int> results;
for (const auto& query : queries) {
int q_type = query[0];
if (q_type == 1) {
int emp_id = query[1];
int amount = query[2];
seg_tree.update(emp_id, amount);
} else if (q_type == 2) {
int left = query[1];
int right = query[2];
results.push_back(seg_tree.query(left, right));
}
}
return results;
}
Netapp โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Trellix | Software Developer | 2024, 2023 Grads | Expected Salary: 18-20 LPA
https://trellix.wd1.myworkdayjobs.com/EnterpriseCareers/job/India-Bangalore/Software-Development-Engineer_JR0033710
https://trellix.wd1.myworkdayjobs.com/EnterpriseCareers/job/India-Bangalore/Software-Development-Engineer_JR0033710
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐NewsBytes is hiring for Frontend Developer
Expected Salary: 6-12 LPA
Experience: 0-2 years
Apply here:
https://linkedin.com/jobs/view/3936961313/?alternateChannel=search&trk=d_flagship3_search_srp_jobs
Expected Salary: 6-12 LPA
Experience: 0-2 years
Apply here:
https://linkedin.com/jobs/view/3936961313/?alternateChannel=search&trk=d_flagship3_search_srp_jobs
Linkedin
Alkye hiring Junior Frontend Developer in Mohali district, India | LinkedIn
Posted 3:44:43 AM. About UsAt Alkye, we are at the forefront of the digital and technology industry, creatingโฆ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)
๐Dimagi is hiring for Associate Mobile Software Engineer
Experience: 0-2 years
Apply here:
https://dimagi.com/careers/job/5997359/?gh_jid=5997359&gh_src=c272094e1us
Experience: 0-2 years
Apply here:
https://dimagi.com/careers/job/5997359/?gh_jid=5997359&gh_src=c272094e1us
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐SMC Squared India is hiring for Software Engineer (Fresher)
Expected Salary: 8-16 LPA
Batch: 2023
Apply here:
https://linkedin.com/jobs/view/3936815035/
Expected Salary: 8-16 LPA
Batch: 2023
Apply here:
https://linkedin.com/jobs/view/3936815035/
Linkedin
SMC Squared India hiring Software Engineer (Fresher) in Hyderabad, Telangana, India | LinkedIn
Posted 10:45:50 AM. Calling all trained freshers!
Are you a recent graduate eager to kickstart your career with aโฆSee this and similar jobs on LinkedIn.
Are you a recent graduate eager to kickstart your career with aโฆSee this and similar jobs on LinkedIn.
๐คฉ1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Tata 1mg
Role: Summer Intern (Backend - Engineering)
Batch: 2025 passouts
Apply Link: https://docs.google.com/forms/d/1OTFWZG4ugzHdoVJHLlO7qpWSzNMhBdwAMov-YUnBqIE/viewform
Role: Summer Intern (Backend - Engineering)
Batch: 2025 passouts
Apply Link: https://docs.google.com/forms/d/1OTFWZG4ugzHdoVJHLlO7qpWSzNMhBdwAMov-YUnBqIE/viewform
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐CoffeeBeans is hiring for Data Science / DevOps / QA - Fresher
Expected Salary: Competitive
Apply here:
https://coffeebeans.io/careers?jobId=9PRLRPzAjkLy
Expected Salary: Competitive
Apply here:
https://coffeebeans.io/careers?jobId=9PRLRPzAjkLy
coffeebeans.io
Careers
Be a part of passionate tech community and a caffeine-fueled work culture. A fast-paced environment where big ideas are encouraged and put into action
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Virtualmate.ai is hiring Android Development Intern
For 2024, 2025, 2026 grads
https://in.linkedin.com/jobs/view/android-development-intern-at-virtualmate-ai-3936982965?position=4&pageNum=0&refId=bbrC6FlwfyHWhJ2b%2B1frUA%3D%3D&trackingId=FNwhXd4GXVTmJ6j6jDOBtA%3D%3D&trk=public_jobs_jserp-result_search-card
For 2024, 2025, 2026 grads
https://in.linkedin.com/jobs/view/android-development-intern-at-virtualmate-ai-3936982965?position=4&pageNum=0&refId=bbrC6FlwfyHWhJ2b%2B1frUA%3D%3D&trackingId=FNwhXd4GXVTmJ6j6jDOBtA%3D%3D&trk=public_jobs_jserp-result_search-card
Linkedin
Virtualmate.ai hiring Android Development Intern in New Delhi, Delhi, India | LinkedIn
Posted 9:05:59 AM. TImension.ai is on a mission to create a revolutionary AI products like Timension Movie Studioโฆ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)
Software Engineer Intern At Optionlogy
Location: Remote
Stipend: 25K-30K per month
Link: https://bit.ly/3KjDUFe
Location: Remote
Stipend: 25K-30K per month
Link: https://bit.ly/3KjDUFe
Linkedin
Optionlogy hiring Software Engineer Intern in India | LinkedIn
Posted 9:10:53 AM. Optionlogy is an auto trading platform that provides innovative tools for everyday traders to findโฆ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)
Flipkart is sponsoring an Infosec Certification Program.
Batch : 2024,2023,2022 passouts
Stipend : 40,000 INR per month for 6 months.
This is for cyber security folks.
https://docs.google.com/forms/u/0/d/e/1FAIpQLSdzHIzqmoKYLI7FnEq1Tlax4i3yWP5H-0qwSUcwWw-JWo4x7Q/viewform?usp=send_form&pli=1
Batch : 2024,2023,2022 passouts
Stipend : 40,000 INR per month for 6 months.
This is for cyber security folks.
https://docs.google.com/forms/u/0/d/e/1FAIpQLSdzHIzqmoKYLI7FnEq1Tlax4i3yWP5H-0qwSUcwWw-JWo4x7Q/viewform?usp=send_form&pli=1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Hiring Quality Trainee with 0 to 2 years of experience in Quality from Automotive background.
BE EEE / Mechanical / ECE freshers or 1 to 2 yrs experienced can apply
Interested candidates can share profile to recruitment@besmakindia.com with the subject line " Trainee - Quality"
Job Location- Oragadam
BE EEE / Mechanical / ECE freshers or 1 to 2 yrs experienced can apply
Interested candidates can share profile to recruitment@besmakindia.com with the subject line " Trainee - Quality"
Job Location- Oragadam
public static int solution(String S, String T) {
int n = S.length();
int[] sArray = new int[n];
int[] tArray = new int[n];
for (int i = 0; i < n; i++) {
sArray[i] = S.charAt(i) - '0';
tArray[i] = T.charAt(i) - '0';
}
int totalMoves = 0;
for (int i = 0; i < n - 1; i++) {
int currentDigitS = sArray[i];
int targetDigitT = tArray[i];
if (currentDigitS != targetDigitT) {
int diff = (targetDigitT - currentDigitS + 10) % 10;
sArray[i] = (sArray[i] + diff) % 10;
sArray[i + 1] = (sArray[i + 1] + diff) % 10;
totalMoves += diff;
}
}
if (sArray[n - 1] != tArray[n - 1]) {
return -1;
}
return totalMoves;
}
Hashedin โ
int n = S.length();
int[] sArray = new int[n];
int[] tArray = new int[n];
for (int i = 0; i < n; i++) {
sArray[i] = S.charAt(i) - '0';
tArray[i] = T.charAt(i) - '0';
}
int totalMoves = 0;
for (int i = 0; i < n - 1; i++) {
int currentDigitS = sArray[i];
int targetDigitT = tArray[i];
if (currentDigitS != targetDigitT) {
int diff = (targetDigitT - currentDigitS + 10) % 10;
sArray[i] = (sArray[i] + diff) % 10;
sArray[i + 1] = (sArray[i + 1] + diff) % 10;
totalMoves += diff;
}
}
if (sArray[n - 1] != tArray[n - 1]) {
return -1;
}
return totalMoves;
}
Hashedin โ
public int solution(int[] T) {
int N = T.length;
List<Integer>[] tree = new ArrayList[N];
for (int i = 0; i < N; i++) {
tree[i] = new ArrayList<>();
}
for (int i = 1; i < N; i++) {
tree[i].add(T[i]);
tree[T[i]].add(i);
}
return dfs(0, -1, tree, false);
}
private int dfs(int current, int parent, List<Integer>[] tree, boolean usedTicket) {
int maxCities = 1;
for (int neighbor : tree[current]) {
if (neighbor != parent) {
if (neighbor % 2 == 1) {
if (!usedTicket) {
maxCities = Math.max(maxCities, 1 + dfs(neighbor, current, tree, true));
}
} else {
maxCities = Math.max(maxCities, 1 + dfs(neighbor, current, tree, usedTicket));
}
}
}
return maxCities;
}
Hashedin โ
int N = T.length;
List<Integer>[] tree = new ArrayList[N];
for (int i = 0; i < N; i++) {
tree[i] = new ArrayList<>();
}
for (int i = 1; i < N; i++) {
tree[i].add(T[i]);
tree[T[i]].add(i);
}
return dfs(0, -1, tree, false);
}
private int dfs(int current, int parent, List<Integer>[] tree, boolean usedTicket) {
int maxCities = 1;
for (int neighbor : tree[current]) {
if (neighbor != parent) {
if (neighbor % 2 == 1) {
if (!usedTicket) {
maxCities = Math.max(maxCities, 1 + dfs(neighbor, current, tree, true));
}
} else {
maxCities = Math.max(maxCities, 1 + dfs(neighbor, current, tree, usedTicket));
}
}
}
return maxCities;
}
Hashedin โ
public int solution(int[] A) {
int N = A.length;
Arrays.sort(A);
int minMoves = N;
for (int i = 0; i <= N - 1; i++) {
int end = A[i] + N - 1;
int r= binarySearch(A, end);
int balls= r- i + 1;
int moves = N - balls;
minMoves = Math.min(minMoves, moves);
}
return minMoves;
}
private int binarySearch(int[] A, int target) {
int low = 0;
int high = A.length - 1;
while (low <= high) {
int mid = low + (high - low) / 2;
if (A[mid] <= target) {
low = mid + 1;
} else {
high = mid - 1;
}
}
return high;
}
Hashedin โ
int N = A.length;
Arrays.sort(A);
int minMoves = N;
for (int i = 0; i <= N - 1; i++) {
int end = A[i] + N - 1;
int r= binarySearch(A, end);
int balls= r- i + 1;
int moves = N - balls;
minMoves = Math.min(minMoves, moves);
}
return minMoves;
}
private int binarySearch(int[] A, int target) {
int low = 0;
int high = A.length - 1;
while (low <= high) {
int mid = low + (high - low) / 2;
if (A[mid] <= target) {
low = mid + 1;
} else {
high = mid - 1;
}
}
return high;
}
Hashedin โ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Techmatter Technologies is hiring Fullstack Software Developer
For 2024, 2023, 2022, 2021, 2020 grads
https://www.instahyre.com/job-318551-fullstack-software-developer-data-at-techmatters-technologies-3-mumbai/
For 2024, 2023, 2022, 2021, 2020 grads
https://www.instahyre.com/job-318551-fullstack-software-developer-data-at-techmatters-technologies-3-mumbai/
Instahyre
Fullstack Software Developer - Data job at Techmatters Technologies - Instahyre
Techmatters Technologies is looking for a Fullstack Software Developer - Data in Mumbai with 0-4 years of experience in Full-Stack Development, Other Software Development, Python, SQL, pandas, Data Analysis, etc. Apply today and get your dream job at Techmattersโฆ
public int solution(int[] A) {
int N = A.length;
Arrays.sort(A);
int minMoves = N;
for (int i = 0; i <= N - 1; i++) {
int end = A[i] + N - 1;
int r= binarySearch(A, end);
int balls= r- i + 1;
int moves = N - balls;
minMoves = Math.min(minMoves, moves);
}
return minMoves;
}
private int binarySearch(int[] A, int target) {
int low = 0;
int high = A.length - 1;
while (low <= high) {
int mid = low + (high - low) / 2;
if (A[mid] <= target) {
low = mid + 1;
} else {
high = mid - 1;
}
}
return high;
}
int N = A.length;
Arrays.sort(A);
int minMoves = N;
for (int i = 0; i <= N - 1; i++) {
int end = A[i] + N - 1;
int r= binarySearch(A, end);
int balls= r- i + 1;
int moves = N - balls;
minMoves = Math.min(minMoves, moves);
}
return minMoves;
}
private int binarySearch(int[] A, int target) {
int low = 0;
int high = A.length - 1;
while (low <= high) {
int mid = low + (high - low) / 2;
if (A[mid] <= target) {
low = mid + 1;
} else {
high = mid - 1;
}
}
return high;
}
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <vector>
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
struct Area {
int startR, endR, startC, endC, size;
bool horizontal;
Area(int sr, int er, int sc, int ec, int s, bool h)
: startR(sr), endR(er), startC(sc), endC(ec), size(s), horizontal(h) {}
};
int maxCultivationArea(const vector<string>& A) {
int N = A.size();
int M = A[0].size();
vector<Area> areas;
for (int r = 0; r < N; ++r) {
int startC = 0;
while (startC < M) {
if (A[r][startC] == '.') {
int endC = startC;
while (endC < M && A[r][endC] == '.') endC++;
areas.emplace_back(r, r, startC, endC - 1, endC - startC, true);
startC = endC;
} else {
startC++;
}
}
}
for (int c = 0; c < M; ++c) {
int startR = 0;
while (startR < N) {
if (A[startR][c] == '.') {
int endR = startR;
while (endR < N && A[endR][c] == '.') endR++;
areas.emplace_back(startR, endR - 1, c, c, endR - startR, false);
startR = endR;
} else {
startR++;
}
}
}
int maxCultivation = 0;
for (int i = 0; i < areas.size(); ++i) {
for (int j = i + 1; j < areas.size(); ++j) {
const Area& a1 = areas[i];
const Area& a2 = areas[j];
bool overlap = false;
if (a1.horizontal && a2.horizontal) {
overlap = a1.startR == a2.startR && !(a1.endC < a2.startC || a2.endC < a1.startC);
} else if (!a1.horizontal && !a2.horizontal) {
overlap = a1.startC == a2.startC && !(a1.endR < a2.startR || a2.endR < a1.startR);
} else {
if (a1.horizontal) {
overlap = a1.startR <= a2.endR && a1.startR >= a2.startR && a2.startC <= a1.endC && a2.startC >= a1.startC;
} else {
overlap = a2.startR <= a1.endR && a2.startR >= a1.startR && a1.startC <= a2.endC && a1.startC >= a2.startC;
}
}
if (!overlap) {
maxCultivation = max(maxCultivation, a1.size + a2.size);
}
}
}
for (const auto& area : areas) {
maxCultivation = max(maxCultivation, area.size);
}
return maxCultivation;
}
#include <string>
#include <algorithm>
#include <iostream>
using namespace std;
struct Area {
int startR, endR, startC, endC, size;
bool horizontal;
Area(int sr, int er, int sc, int ec, int s, bool h)
: startR(sr), endR(er), startC(sc), endC(ec), size(s), horizontal(h) {}
};
int maxCultivationArea(const vector<string>& A) {
int N = A.size();
int M = A[0].size();
vector<Area> areas;
for (int r = 0; r < N; ++r) {
int startC = 0;
while (startC < M) {
if (A[r][startC] == '.') {
int endC = startC;
while (endC < M && A[r][endC] == '.') endC++;
areas.emplace_back(r, r, startC, endC - 1, endC - startC, true);
startC = endC;
} else {
startC++;
}
}
}
for (int c = 0; c < M; ++c) {
int startR = 0;
while (startR < N) {
if (A[startR][c] == '.') {
int endR = startR;
while (endR < N && A[endR][c] == '.') endR++;
areas.emplace_back(startR, endR - 1, c, c, endR - startR, false);
startR = endR;
} else {
startR++;
}
}
}
int maxCultivation = 0;
for (int i = 0; i < areas.size(); ++i) {
for (int j = i + 1; j < areas.size(); ++j) {
const Area& a1 = areas[i];
const Area& a2 = areas[j];
bool overlap = false;
if (a1.horizontal && a2.horizontal) {
overlap = a1.startR == a2.startR && !(a1.endC < a2.startC || a2.endC < a1.startC);
} else if (!a1.horizontal && !a2.horizontal) {
overlap = a1.startC == a2.startC && !(a1.endR < a2.startR || a2.endR < a1.startR);
} else {
if (a1.horizontal) {
overlap = a1.startR <= a2.endR && a1.startR >= a2.startR && a2.startC <= a1.endC && a2.startC >= a1.startC;
} else {
overlap = a2.startR <= a1.endR && a2.startR >= a1.startR && a1.startC <= a2.endC && a1.startC >= a2.startC;
}
}
if (!overlap) {
maxCultivation = max(maxCultivation, a1.size + a2.size);
}
}
}
for (const auto& area : areas) {
maxCultivation = max(maxCultivation, area.size);
}
return maxCultivation;
}
๐1