๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
public static int solution(int N, int K, int[] cost, int[] sell) {
int maxProfit = 0;
List<Item> items = new ArrayList<>();
for (int i = 0; i < N; i++) {
items.add(new Item(cost[i], sell[i]));
}
Collections.sort(items, Comparator.comparingInt(Item::getSellPrice));
int low = 0, high = items.size() - 1;
while (low <= high) {
int mid = low + (high - low) / 2;
int buyingPrice = items.get(mid).getBuyPrice();
if (K >= buyingPrice) {
maxProfit = Math.max(maxProfit, items.get(mid).getSellPrice() - buyingPrice);
low = mid + 1;
} else {
high = mid - 1;
}
}
return maxProfit;
}
}
class Item {
private int buyPrice;
private int sellPrice;
public Item(int buyPrice, int sellPrice) {
this.buyPrice = buyPrice;
this.sellPrice = sellPrice;
}
public int getBuyPrice() {
return buyPrice;
}
public int getSellPrice() {
return sellPrice;
}
}
Profits โ
int maxProfit = 0;
List<Item> items = new ArrayList<>();
for (int i = 0; i < N; i++) {
items.add(new Item(cost[i], sell[i]));
}
Collections.sort(items, Comparator.comparingInt(Item::getSellPrice));
int low = 0, high = items.size() - 1;
while (low <= high) {
int mid = low + (high - low) / 2;
int buyingPrice = items.get(mid).getBuyPrice();
if (K >= buyingPrice) {
maxProfit = Math.max(maxProfit, items.get(mid).getSellPrice() - buyingPrice);
low = mid + 1;
} else {
high = mid - 1;
}
}
return maxProfit;
}
}
class Item {
private int buyPrice;
private int sellPrice;
public Item(int buyPrice, int sellPrice) {
this.buyPrice = buyPrice;
this.sellPrice = sellPrice;
}
public int getBuyPrice() {
return buyPrice;
}
public int getSellPrice() {
return sellPrice;
}
}
Profits โ
๐1
Critical Reasoning
Accenture 2pm slot โ
Accenture 2pm slot โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Binocs is hiring SDE Intern
Stipend - 30,000-80,000 per month
For 2023, 2024 grads
https://in.linkedin.com/jobs/view/software-development-internship-in-bangalore-at-binocs-3943703711?position=1&pageNum=0&refId=ReZzpZF3lAxAFTqaHy6QSw%3D%3D&trackingId=3rLtZwkBJgAwfOrUgjVkmA%3D%3D&trk=public_jobs_jserp-result_search-card
Stipend - 30,000-80,000 per month
For 2023, 2024 grads
https://in.linkedin.com/jobs/view/software-development-internship-in-bangalore-at-binocs-3943703711?position=1&pageNum=0&refId=ReZzpZF3lAxAFTqaHy6QSw%3D%3D&trackingId=3rLtZwkBJgAwfOrUgjVkmA%3D%3D&trk=public_jobs_jserp-result_search-card
Linkedin
Binocs hiring Software Development Internship in Bangalore in Bengaluru, Karnataka, India | LinkedIn
Posted 7:55:20 PM. Selected Intern's Day-to-day Responsibilities Include Support in implementation of new featuresโฆ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)
TOEFL India Championship Round 1
Eligibility: Currently Undergraduate in third year, 4th year to working professional upto 2 years only.
Link: https://bit.ly/3KylkcA
Last day to participate: 10th June
P.S: In case you are interested, try kro aj hi krlo (Only 20 mins)
Eligibility: Currently Undergraduate in third year, 4th year to working professional upto 2 years only.
Link: https://bit.ly/3KylkcA
Last day to participate: 10th June
P.S: In case you are interested, try kro aj hi krlo (Only 20 mins)
practice.geeksforgeeks.org
Contest | TOEFL India Championship Round 1
GeeksforGeeks is partnering with ETS India to present the TOEFL India Championship, offering a chance to win prize money worth 15 Lakh Rupees and help you realize your aspirations of studying abroad.This is the Round 1 of the Championship.Take this quickโฆ