int solve(int N, int K, const vector<int> houses) {
map<int,int>mp;
for(int i=0;i<houses.size();i++){
mp[houses[i]-1]=i+1;
}
multiset<int>s;
int ans=INT_MAX;
for(int i=0;i<K;i++){
s.insert(mp[i]);
}
ans=*s.rbegin();
for(int i=1;i+K-1<N;i++){
s.erase(s.find(mp[i-1]));
s.insert(mp[i+K-1]);
ans=min(ans,int(*s.rbegin()));
}
return ans;
}
Happy Neighborhood โ
map<int,int>mp;
for(int i=0;i<houses.size();i++){
mp[houses[i]-1]=i+1;
}
multiset<int>s;
int ans=INT_MAX;
for(int i=0;i<K;i++){
s.insert(mp[i]);
}
ans=*s.rbegin();
for(int i=1;i+K-1<N;i++){
s.erase(s.find(mp[i-1]));
s.insert(mp[i+K-1]);
ans=min(ans,int(*s.rbegin()));
}
return ans;
}
Happy Neighborhood โ
def solution(a, b):
c = {}
d = {}
for x, y in b:
if x not in c:
c[x] = 0
d[x] = 0
c[x] += y
d[x] += 1
best_dish = None
max_avg = 0
for x in c:
avg = c[x] / d[x]
if (avg > max_avg) or (avg == max_avg and (best_dish is None or x < best_dish)):
max_avg = avg
best_dish = x
print(best_dish)
def main():
a = int(input())
b = [tuple(map(int, input().split())) for _ in range(a)]
solution(a, b)
if name == "main":
main()
Food Ratings โ
c = {}
d = {}
for x, y in b:
if x not in c:
c[x] = 0
d[x] = 0
c[x] += y
d[x] += 1
best_dish = None
max_avg = 0
for x in c:
avg = c[x] / d[x]
if (avg > max_avg) or (avg == max_avg and (best_dish is None or x < best_dish)):
max_avg = avg
best_dish = x
print(best_dish)
def main():
a = int(input())
b = [tuple(map(int, input().split())) for _ in range(a)]
solution(a, b)
if name == "main":
main()
Food Ratings โ
int getSpecialSubstring(string s, int k, string charValue) {
unordered_map<char, bool> is_normal;
for (int i = 0; i < 26; i++) {
is_normal['a' + i] = (charValue[i] == '0');
}
int left = 0;
int max_length = 0;
int normal_count = 0;
for (int right = 0; right < s.length(); right++) {
if (is_normal[s[right]]) {
normal_count += 1;
}
while (normal_count > k) {
if (is_normal[s[left]]) {
normal_count -= 1;
}
left += 1;
}
max_length = max(max_length, right - left + 1);
}
return max_length;
}
unordered_map<char, bool> is_normal;
for (int i = 0; i < 26; i++) {
is_normal['a' + i] = (charValue[i] == '0');
}
int left = 0;
int max_length = 0;
int normal_count = 0;
for (int right = 0; right < s.length(); right++) {
if (is_normal[s[right]]) {
normal_count += 1;
}
while (normal_count > k) {
if (is_normal[s[left]]) {
normal_count -= 1;
}
left += 1;
}
max_length = max(max_length, right - left + 1);
}
return max_length;
}
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: CloudSEK
Role: SDE Intern
Batch eligible: 2025 and 2026 grads
Apply: https://www.linkedin.com/jobs/view/4071357511/
Role: SDE Intern
Batch eligible: 2025 and 2026 grads
Apply: https://www.linkedin.com/jobs/view/4071357511/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: McAfee
Role: Graduate Technical Intern
Batch eligible: 2025 and 2026 grads
Apply: https://careers.mcafee.com/global/en/job/MCAFGLOBALJR0031349ENGLOBALEXTERNAL/Graduate-Technical-Intern
Role: Graduate Technical Intern
Batch eligible: 2025 and 2026 grads
Apply: https://careers.mcafee.com/global/en/job/MCAFGLOBALJR0031349ENGLOBALEXTERNAL/Graduate-Technical-Intern
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Batch: 2024, 2025
careers@innobyteservices.com
careers@innobyteservices.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Python Developer
โข Requirements: Proficiency in Python, knowledge of web frameworks (Django/Flask), and understanding of databases (SQL/NoSQL).
iOS Developer
โข Requirements: Proficiency in Swift/Objective-C, experience with iOS frameworks (UIKit, Core Data), and understanding of RESTful APIs.
Frontend Developer
โข Requirements: Proficiency in HTML, CSS, JavaScript, experience with frontend frameworks (React/Angular/Vue.js), and understanding of responsive design.
๐จSend your resume to hr@technostacks.com
OR
Connect : +91 9909712617
โข Requirements: Proficiency in Python, knowledge of web frameworks (Django/Flask), and understanding of databases (SQL/NoSQL).
iOS Developer
โข Requirements: Proficiency in Swift/Objective-C, experience with iOS frameworks (UIKit, Core Data), and understanding of RESTful APIs.
Frontend Developer
โข Requirements: Proficiency in HTML, CSS, JavaScript, experience with frontend frameworks (React/Angular/Vue.js), and understanding of responsive design.
๐จSend your resume to hr@technostacks.com
OR
Connect : +91 9909712617
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Company Name : Indmoney
Role : Machine Learning Intern
Degree : B.Tech - Computer Science or IT and M.Sc. in computer science or MCA
Batch : 2025,2026,2027
Internship duration: 6 Months
Skill Set : Python and scikit-learn or PyTorch in any of your projects
Location : Bangalore
๐ปApply Link: https://docs.google.com/forms/d/e/1FAIpQLSdKgT_x8aZmh0dMUcdzQmoH0HJenSEYHbRe9D4_F6bayft-HA/viewform
Role : Machine Learning Intern
Degree : B.Tech - Computer Science or IT and M.Sc. in computer science or MCA
Batch : 2025,2026,2027
Internship duration: 6 Months
Skill Set : Python and scikit-learn or PyTorch in any of your projects
Location : Bangalore
๐ปApply Link: https://docs.google.com/forms/d/e/1FAIpQLSdKgT_x8aZmh0dMUcdzQmoH0HJenSEYHbRe9D4_F6bayft-HA/viewform
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Company Name : PayU
Role : Data Intern
Degree : Engineering, Statistics, Computer Science, Mathematics or other similar quantitative fields from a premier institute
Batch : 2025,2026,2027
Internship duration: 2 โ 12 months
Skill Set : Excellent understanding of SQL, Python.
Location : Mumbai, Bangalore, Gurgaon
๐ปApply Link: https://jobs.eu.lever.co/payu/ee2691f3-64c7-4251-9284-e91aa40b2932
Role : Data Intern
Degree : Engineering, Statistics, Computer Science, Mathematics or other similar quantitative fields from a premier institute
Batch : 2025,2026,2027
Internship duration: 2 โ 12 months
Skill Set : Excellent understanding of SQL, Python.
Location : Mumbai, Bangalore, Gurgaon
๐ปApply Link: https://jobs.eu.lever.co/payu/ee2691f3-64c7-4251-9284-e91aa40b2932
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Company Name : Kirana Club
Batch : 2025 passouts
Role : 6 Months Internship - Full Stack/React Native/Product and a few non tech.
Stipend : 25,000-40,000 INR per month
๐ปApply Link : http://kirana.club/internship2025
Batch : 2025 passouts
Role : 6 Months Internship - Full Stack/React Native/Product and a few non tech.
Stipend : 25,000-40,000 INR per month
๐ปApply Link : http://kirana.club/internship2025
Kirana Club - India's Largest Kirana Network
Looking for your next Adventure? | Kirana Club Internship 2025
Weโre looking for sharp minds to join our team across all verticals โ and it could be you!
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Nxt Semiconductor Hiring
Role : Internship
Duration : 11 to 12 months
Stipend : 30k monthly
Batch : 2023, 2024,2025
Link : https://nxp.wd3.myworkdayjobs.com/careers/job/Bangalore-Nagavara/Internship---Software-Development--2024-_R-10052539
Role : Internship
Duration : 11 to 12 months
Stipend : 30k monthly
Batch : 2023, 2024,2025
Link : https://nxp.wd3.myworkdayjobs.com/careers/job/Bangalore-Nagavara/Internship---Software-Development--2024-_R-10052539
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Sign Up | LinkedIn
500 million+ members | Manage your professional identity. Build and engage with your professional network. Access knowledge, insights and opportunities.
def solve(N, K, X, A):
count = 0
for subset_mask in range(1 << N):
subset = [A[i] for i in range(N) if (subset_mask & (1 << i))]
v = 0
for start in range(len(subset)):
segment_sum = 0
for end in range(start, len(subset)):
segment_sum += subset[end]
if segment_sum >= X:
v += 1
if v >= K:
count += 1
return count
UST โ
count = 0
for subset_mask in range(1 << N):
subset = [A[i] for i in range(N) if (subset_mask & (1 << i))]
v = 0
for start in range(len(subset)):
segment_sum = 0
for end in range(start, len(subset)):
segment_sum += subset[end]
if segment_sum >= X:
v += 1
if v >= K:
count += 1
return count
UST โ
๐1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 100005;
vector<int> tree[MAX_N];
vector<int> houses[MAX_N];
int A[MAX_N];
int parent[MAX_N];
void dfs(int node) {
houses[node].push_back(A[node]);
for (int child : tree[node]) {
if (child == parent[node]) continue;
parent[child] = node;
dfs(child);
houses[node].insert(houses[node].end(), houses[child].begin(), houses[child].end());
}
sort(houses[node].begin(), houses[node].end());
}
int getMaxD(int X, int K, vector<int>& housesInSubtree) {
int low = 0, high = 1000000000, bestD = 0;
while (low <= high) {
int mid = (low + high) / 2;
int count = 0;
int left = X - mid, right = X + mid;
auto lower = lower_bound(housesInSubtree.begin(), housesInSubtree.end(), left);
auto upper = upper_bound(housesInSubtree.begin(), housesInSubtree.end(), right);
count = upper - lower;
if (count <= K) {
bestD = mid;
low = mid + 1;
} else {
high = mid - 1;
}
}
return bestD;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int N, Q;
cin >> N >> Q;
for (int i = 1; i <= N; ++i) {
cin >> A[i];
}
for (int i = 1; i < N; ++i) {
int u, v;
cin >> u >> v;
tree[u].push_back(v);
tree[v].push_back(u);
}
parent[1] = -1;
dfs(1);
int result = 0;
while (Q--) {
int U, X, K;
cin >> U >> X >> K;
int d = getMaxD(X, K, houses[U]);
result ^= d;
}
cout << result << endl;
return 0;
}
Bad Guy โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Equifax is hiring Java Developer
For 2023, 2024 grads
Location: Pune / Trivandrum
https://careers.equifax.com/en/jobs/j00162626/java-developer-entry/
For 2023, 2024 grads
Location: Pune / Trivandrum
https://careers.equifax.com/en/jobs/j00162626/java-developer-entry/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Orange Health is hiring Software Engineer
For 2021, 2022, 2023 grads
Location: Bangalore
https://app.pyjamahr.com/careers?company=Orange%20Health&job_id=159193&company_uuid=8A364EBF43&source=LINKEDIN&apply_now=true
For 2021, 2022, 2023 grads
Location: Bangalore
https://app.pyjamahr.com/careers?company=Orange%20Health&job_id=159193&company_uuid=8A364EBF43&source=LINKEDIN&apply_now=true