#include <vector>
#include <algorithm>
int getMinimumTime(const std::vector<int>& requestedServers, const std::vector<int>& transitionTime) {
int n = requestedServers.size();
int m = transitionTime.size();
int min_time = 0;
for (int i = 1; i < n; i++) {
int current = requestedServers[i] - 1;
int previous = requestedServers[i - 1] - 1;
int distance = std::min((current - previous + m) % m, (previous - current + m) % m);
min_time += distance * transitionTime[previous];
}
return min_time;
}
Get Minimum Time โ
โค1
import heapq
class GPUAllocator:
def __init__(self):
self.available_gpus = []
self.max_gpu_id = 10**6
self.next_gpu_id = 1
self.add_gpus(self.max_gpu_id)
def add_gpus(self, count):
for _ in range(count):
heapq.heappush(self.available_gpus, self.next_gpu_id)
self.next_gpu_id += 1
def smallestUnoccupied(self):
if not self.available_gpus:
self.add_gpus(100)
return self.available_gpus[0] if self.available_gpus else -1
# Example usage
allocator = GPUAllocator()
print(allocator.smallestUnoccupied())
print(allocator.smallestUnoccupied())
GPU
from collections import defaultdict
def findOptimalResources(arr, k):
n = len(arr)
if k > n:
return -1
window_sum = 0
max_sum = 0
unique_elements = defaultdict(int)
left = 0
for right in range(n):
window_sum += arr[right]
unique_elements[arr[right]] += 1
if right - left + 1 > k:
window_sum -= arr[left]
unique_elements[arr[left]] -= 1
if unique_elements[arr[left]] == 0:
del unique_elements[arr[left]]
left += 1
if right - left + 1 == k and len(unique_elements) == k:
max_sum = max(max_sum, window_sum)
return max_sum if max_sum != 0 else -1
๐ฑ1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
long findMaximumEarning(vector<int> send, vector<int> receive, vector<int> amount, vector<int> capacity) {
int n = send.size();
int m = capacity.size();
vector<tuple<int, int, int>> tasks;
for (int i = 0; i < n; i++) {
tasks.push_back(make_tuple(max(send[i], receive[i]), amount[i], i));
}
sort(tasks.begin(), tasks.end(), [](const auto& a, const auto& b) {
return get<1>(a) > get<1>(b);
});
sort(capacity.begin(), capacity.end());
long totalEarnings = 0;
vector<bool> used(m, false);
for (const auto& task : tasks) {
int taskData = get<0>(task);
int taskEarning = get<1>(task);
for (int i = 0; i < m; i++) {
if (!used[i] && capacity[i] >= taskData) {
totalEarnings += taskEarning;
used[i] = true;
break;
}
}
}
return totalEarnings;
}
int n = send.size();
int m = capacity.size();
vector<tuple<int, int, int>> tasks;
for (int i = 0; i < n; i++) {
tasks.push_back(make_tuple(max(send[i], receive[i]), amount[i], i));
}
sort(tasks.begin(), tasks.end(), [](const auto& a, const auto& b) {
return get<1>(a) > get<1>(b);
});
sort(capacity.begin(), capacity.end());
long totalEarnings = 0;
vector<bool> used(m, false);
for (const auto& task : tasks) {
int taskData = get<0>(task);
int taskEarning = get<1>(task);
for (int i = 0; i < m; i++) {
if (!used[i] && capacity[i] >= taskData) {
totalEarnings += taskEarning;
used[i] = true;
break;
}
}
}
return totalEarnings;
}
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Swipe
๐ Job Title: SDE Intern
โ๐ป YOE: 2025 and 2026 grads
โก๏ธ Apply: https://www.ycombinator.com/companies/swipe-2/jobs/G3KCJ88-sde-intern
Please do share in your college grps and in case you are applying please react on this post:) ๐โค๏ธ
๐ Job Title: SDE Intern
โ๐ป YOE: 2025 and 2026 grads
โก๏ธ Apply: https://www.ycombinator.com/companies/swipe-2/jobs/G3KCJ88-sde-intern
Please do share in your college grps and in case you are applying please react on this post:) ๐โค๏ธ
Y Combinator
SDE, Intern at Swipe
Weโre looking for passionate engineers to join our team and assist with developing and maintaining our software products. The ideal candidate should have a passion for programming, be eager to learn, and be able to work in a team environment.
Roles & โฆ
Roles & โฆ
SELECT
ROUND(
(COUNT(CASE WHEN polygon_name = 'Adarsh Palm Retreat' THEN 1 END) * 100.0) /
COUNT(*),
2
) AS order_share
FROM
POLYGON
WHERE
order_date = '2020-12-31';
Swiggy Order share โ
SELECT
'within 100' AS BUCKET,
COUNT(*) AS Orders
FROM cuisine_orders
WHERE item_total <= 100
UNION ALL
SELECT
'within 150' AS BUCKET,
COUNT(*) AS Orders
FROM cuisine_orders
WHERE item_total <= 150
UNION ALL
SELECT
'within 200' AS BUCKET,
COUNT(*) AS Orders
FROM cuisine_orders
WHERE item_total <= 200
ORDER BY BUCKET;
Swiggy Bucket wise order โ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Diligent hiring for Software Engineer l
Bangalore
2024/2023/2022 passouts eligible
https://boards.greenhouse.io/diligentcorporation/jobs/5233594004?s=08
Bangalore
2024/2023/2022 passouts eligible
https://boards.greenhouse.io/diligentcorporation/jobs/5233594004?s=08
job-boards.greenhouse.io
Diligent Corporation
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: Dupont
Role: Frontend Developer
For Graduates: 2023, 2024
https://careers.dupont.com/us/en/job/239966W/Frontend-Developer-Trainee-IT-Fresher-Graduates-2024-23-Batch-only?s=08
Role: Frontend Developer
For Graduates: 2023, 2024
https://careers.dupont.com/us/en/job/239966W/Frontend-Developer-Trainee-IT-Fresher-Graduates-2024-23-Batch-only?s=08
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
25-July-2024 Update: No longer accepting the applications.
ADP is hiringโฆ | Sindhu Vegi | 61 comments
ADP is hiringโฆ | Sindhu Vegi | 61 comments
25-July-2024 Update: No longer accepting the applications.
ADP is hiring freshers who graduated in 2023 or 2024. DM me your resume for referral.
Engineering Graduates โ Associate Functional Consultant | Hyderabad | UK & US Shifts
Required Skills and Qualifications: โฆ
ADP is hiring freshers who graduated in 2023 or 2024. DM me your resume for referral.
Engineering Graduates โ Associate Functional Consultant | Hyderabad | UK & US Shifts
Required Skills and Qualifications: โฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
We're looking for an intern to work on a vision project at Mercedes Benz R&D India (MBRDI). The candidate should be available for 6 months (on site preferred) and should have some prior research experience and knowhow of latest vision trends like NeRF, SAM, CLIP, etc. Please DM a detailed paragraph of your research experience along with your CV or drop me an email at : vasudev.singh@mercedes-benz.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Parspec hiring for ML l
2023 and before batches eligible
https://jobs.lever.co/parspec/f2d3897d-3aee-42f1-937f-0861e93e95c7
2023 and before batches eligible
https://jobs.lever.co/parspec/f2d3897d-3aee-42f1-937f-0861e93e95c7