๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <unordered_map>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
void possible(int N, string S) {
unordered_map<char, int> freq;
for (char c : S) {
freq[c]++;
}
vector<int> a;
for (auto& entry : freq) {
a.push_back(entry.second);
}
sort(a.begin(), a.end());
int v = -1;
int target = a[a.size() / 2];
v = 0;
for (int count : a) {
v += abs(count - target);
}
cout << "YES" << endl;
cout << v / 2 << endl;
}
int main() {
int N;
string S;
cin >> N;
cin >> S;
possible(N, S);
return 0;
}
Coupa โ
#include<bits/stdc++.h>
using namespace std;
long long solve (int N, vector<long long> A, int X) {
vector<long long>dp(N);
long long best_odd_score, best_even_score;
if (A[0] % 2 == 0)
best_even_score = A[0], best_odd_score = -X;
else
best_odd_score = A[0], best_even_score = -X;
for (int i = 1; i < N; i++)
{
if (A[i] % 2)
{
dp[i] = max(best_odd_score + A[i], best_even_score - X + A[i]);
best_odd_score = max(best_odd_score, dp[i]);
}
else
{
dp[i] = max(best_even_score + A[i], best_odd_score - X + A[i]);
best_even_score = max(best_even_score, dp[i]);
}
}
return dp[N - 1];
}
Coin collector โ
def first_meat_orders(num_of_orders, orders, size):
result = []
for i in range(0, num_of_orders-size+1):
screen_orders = orders[i:i+size]
meat_order_found = False
for order in screen_orders:
if order < 0: # Checking for meat-based pizza order
result.append(order)
meat_order_found = True
break
if not meat_order_found:
result.append(0)
meat_order_found = False
return result
SAP Labs โ
result = []
for i in range(0, num_of_orders-size+1):
screen_orders = orders[i:i+size]
meat_order_found = False
for order in screen_orders:
if order < 0: # Checking for meat-based pizza order
result.append(order)
meat_order_found = True
break
if not meat_order_found:
result.append(0)
meat_order_found = False
return result
SAP Labs โ
#include <iostream>
#include <algorithm>
#include <string>
#include <unordered_set>
using namespace std;
string Circular_str(int N, string S1, int M, string S2) {
unordered_set<char> s1_chars(S1.begin(), S1.end());
string best = "";
for (int i = 0; i < M; i++) {
string candidate = "";
for (int j = 0; j < M; j++) {
char ch = S2[(i + j) % M];
if (s1_chars.count(ch)) break;
candidate += ch;
}
if (candidate.size() > best.size() || (candidate.size() == best.size() && candidate > best)) {
best = candidate;
}
}
string result = S1 + best;
sort(result.begin(), result.end(), greater<char>());
return result;
}
int main() {
int N, M;
string S1, S2;
cin >> N >> S1 >> M >> S2;
cout << Circular_str(N, S1, M, S2) << endl;
return 0;
}
Circular Sting โ
#include <algorithm>
#include <string>
#include <unordered_set>
using namespace std;
string Circular_str(int N, string S1, int M, string S2) {
unordered_set<char> s1_chars(S1.begin(), S1.end());
string best = "";
for (int i = 0; i < M; i++) {
string candidate = "";
for (int j = 0; j < M; j++) {
char ch = S2[(i + j) % M];
if (s1_chars.count(ch)) break;
candidate += ch;
}
if (candidate.size() > best.size() || (candidate.size() == best.size() && candidate > best)) {
best = candidate;
}
}
string result = S1 + best;
sort(result.begin(), result.end(), greater<char>());
return result;
}
int main() {
int N, M;
string S1, S2;
cin >> N >> S1 >> M >> S2;
cout << Circular_str(N, S1, M, S2) << endl;
return 0;
}
Circular Sting โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Coupa Mass hiring
Freshers can apply
or
0 to 4 years exp can apply
Batch Eligible: 2020/ 2021/ 2022/ 2023/ 2024
CTC: 10 LPA to 22 LPA
Job Type: Full Time
Location: Pune/Hyderabad
Exam and interview is virtual
Apply link :https://jobs.lever.co/coupa/66f3c112-530f-40dc-b6bf-1d179df2d535
Freshers can apply
or
0 to 4 years exp can apply
Batch Eligible: 2020/ 2021/ 2022/ 2023/ 2024
CTC: 10 LPA to 22 LPA
Job Type: Full Time
Location: Pune/Hyderabad
Exam and interview is virtual
Apply link :https://jobs.lever.co/coupa/66f3c112-530f-40dc-b6bf-1d179df2d535
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Aspire
Role: Data Engineer Intern
Batch eligible: 2025 and 2026 grads
Apply: https://job-boards.greenhouse.io/aspire/jobs/5319109004?gh_src=499caf134us
Role: Data Engineer Intern
Batch eligible: 2025 and 2026 grads
Apply: https://job-boards.greenhouse.io/aspire/jobs/5319109004?gh_src=499caf134us
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
int solve(int N, int I, vector<int>& RT, vector<int>& A) {
vector<pair<int, int>> r(N);
for (int i = 0; i < N; ++i) {
r[i] = {RT[i], A[i]};
}
sort(r.begin(), r.end(), [](pair<int, int>& a, pair<int, int>& b) {
return a.second > b.second;
});
priority_queue<int, vector<int>, greater<int>> minHeap;
int a = 0;
int b = 0;
for (const auto& t : r) {
int time = t.first;
int c = t.second;
if (a + time <= I && minHeap.size() < c) {
minHeap.push(time);
a += time;
++b;
} else if (!minHeap.empty() && minHeap.top() > time) {
a += time - minHeap.top();
minHeap.pop();
minHeap.push(time);
}
}
return b;
}
Robot Game โ
Globallogic
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
using namespace std;
int solve(const string& str) {
vector<char> vowels = {'a', 'e', 'i', 'o', 'u'};
const int a = 10;
vector<int> freq(26, 0);
for (char c : str) {
freq[c - 'a']++;
}
int n = str.size();
int minCost = INT_MAX;
for (char target : vowels) {
int cost = 0;
for (int i = 0; i < 26; ++i) {
char c = 'a' + i;
if (c == target) continue;
if (freq[i] > 0) {
if (find(vowels.begin(), vowels.end(), c) != vowels.end()) {
cost += freq[i] * abs(c - target);
} else {
cost += freq[i] * a;
}
}
}
minCost = min(minCost, cost);
}
for (char c : str) {
if (find(vowels.begin(), vowels.end(), c) == vowels.end()) {
return minCost;
}
}
return -1;
}
int main() {
string str;
cin >> str;
cout << solve(str) << endl;
return 0;
}
Minimum Cost String โ
#include <bits/stdc++.h>
using namespace std;
int solve(int N, const vector<int>& A) {
if (N == 0) return 0;
vector<int> dp(N, 0);
for (int i = 0; i < N; ++i) {
int a = A[i];
int b = A[i];
for (int j = i; j >= 0; --j) {
a = min(a, A[j]);
b = max(b, A[j]);
int c = b - a;
if (j > 0) {
dp[i] = max(dp[i], dp[j - 1] + c);
} else {
dp[i] = max(dp[i], c);
}
}
}
return dp[N - 1];
}
Suit Up โ
How many of you have received test or interview links for Google FTE/Internship, Morgan Stanley, Goldman Sachs, Atlan or DE Shaw?
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
#hiring #2024passouts #associatesoftwareengineer #techcareersโฆ | Ankita Bansal
๐ Attention 2024 Graduates! Exciting Opportunity Awaits You ๐
Are you a passionate, driven, and innovative student graduating in 2024 with a degree inโฆ
Are you a passionate, driven, and innovative student graduating in 2024 with a degree inโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Freshers hiring Opportunity at Vipul Trade Enter , Gurgaon
Send resume to : Pratibha@capitalplacementservices.com
Phn No : 8595665108
Send resume to : Pratibha@capitalplacementservices.com
Phn No : 8595665108
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Send Your Resume Here
jobs@aimleap.com
jobs@aimleap.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
#hiring #walmart #openings #jobs #opportunities #connections #cfbr | Anjali Kumari | 297 comments
We Walmart looking for both SDE-2 and SDE-3 engineers ๐ฉโ๐ป
Required qualifications:
SDE-2 : 0-2yrs of experience
SDE-3 : 3+ yrs of experience in Java and springboot
SDE-2 :
Do apply -> https://lnkd.in/g3VTTtiJ
SDE-3 :
Do apply -> https://lnkd.in/gH_PPuexโฆ
Required qualifications:
SDE-2 : 0-2yrs of experience
SDE-3 : 3+ yrs of experience in Java and springboot
SDE-2 :
Do apply -> https://lnkd.in/g3VTTtiJ
SDE-3 :
Do apply -> https://lnkd.in/gH_PPuexโฆ