๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000;
vector<int> tree[MAXN];
vector<int> prefixSum;
vector<int> cost;
vector<int> parent;
int N, K;
void dfs(int node, int par, int currentSum) {
prefixSum[node] = currentSum + cost[node];
parent[node] = par;
for (int child : tree[node]) {
if (child != par) {
dfs(child, node, prefixSum[node]);
}
}
}
int solve(int N, int K, vector<int>& A, vector<vector<int>>& edges) {
cost = A;
prefixSum.assign(N, 0);
parent.assign(N, -1);
for (int i = 0; i < N; ++i) {
tree[i].clear();
}
for (auto& edge : edges) {
int u = edge[0] - 1;
int v = edge[1] - 1;
tree[u].push_back(v);
tree[v].push_back(u);
}
dfs(0, -1, 0);
int maxCandies = 0;
for (int i = 0; i < N; ++i) {
int remainingMoney = K;
int candies = 0;
for (int j = i; j != -1; j = parent[j]) {
if (remainingMoney >= cost[j]) {
remainingMoney -= cost[j];
candies++;
} else {
break;
}
}
maxCandies = max(maxCandies, candies);
}
return maxCandies;
}
Zepto โ
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
using namespace std;
int solve(int N, int K, const vector<int>& houses) {
unordered_map<int, int> houseIndex;
for (int i = 0; i < houses.size(); ++i) {
houseIndex[houses[i] - 1] = i + 1;
}
priority_queue<int> pq;
for (int i = 0; i < K; ++i) {
pq.push(houseIndex[i]);
}
int ans = pq.top();
for (int i = 1; i + K - 1 < N; ++i) {
pq.push(houseIndex[i + K - 1]);
while (!pq.empty() && pq.top() > houseIndex[i + K - 1]) {
pq.pop();
}
ans = min(ans, pq.top());
}
return ans;
}
Happy neighborhoodโ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ll long long
#define sz(c) c.size()
ll solve()
{
ll n, m, i, j;
ll k;
ll l, r;
string s;
cin >> s;
n = sz(s);
ll dp[n][5];
memset(dp, 0, sizeof(dp));
if (s[0] == 'a')
dp[0][0] = 1;
for (int i = 1; i < n; i++)
{
if (s[i] == 'a')
{
dp[i][0] = 1 + dp[i - 1][0];
}
else
dp[i][0] = dp[i - 1][0];
if (s[i] == 'e')
{
if (dp[i - 1][1] != 0)
dp[i][1] = 1 + dp[i - 1][1];
if (dp[i - 1][0] != 0)
dp[i][1] = max(dp[i][1], 1 + dp[i - 1][0]);
}
else
dp[i][1] = dp[i - 1][1];
if (s[i] == 'i')
{
if (dp[i - 1][2] != 0)
dp[i][2] = 1 + dp[i - 1][2];
if (dp[i - 1][1] != 0)
dp[i][2] = max(dp[i][2], 1 + dp[i - 1][1]);
}
else
dp[i][2] = dp[i - 1][2];
if (s[i] == 'o')
{
if (dp[i - 1][3] != 0)
dp[i][3] = 1 + dp[i - 1][3];
if (dp[i - 1][2] != 0)
dp[i][3] = max(dp[i][3], 1 + dp[i - 1][2]);
}
else
dp[i][3] = dp[i - 1][3];
if (s[i] == 'u')
{
if (dp[i - 1][4] != 0)
dp[i][4] = 1 + dp[i - 1][4];
if (dp[i - 1][3] != 0)
dp[i][4] = max(dp[i][4], 1 + dp[i - 1][3]);
}
else
dp[i][4] = dp[i - 1][4];
}
cout << dp[n - 1][4];
return 0;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;
t = 1;
// cin>>t;
while (t--)
{
solve();
}
return 0;
}
//longest Vowel subsequence with ordered vowel โ
using namespace std;
#define endl '\n'
#define ll long long
#define sz(c) c.size()
ll solve()
{
ll n, m, i, j;
ll k;
ll l, r;
string s;
cin >> s;
n = sz(s);
ll dp[n][5];
memset(dp, 0, sizeof(dp));
if (s[0] == 'a')
dp[0][0] = 1;
for (int i = 1; i < n; i++)
{
if (s[i] == 'a')
{
dp[i][0] = 1 + dp[i - 1][0];
}
else
dp[i][0] = dp[i - 1][0];
if (s[i] == 'e')
{
if (dp[i - 1][1] != 0)
dp[i][1] = 1 + dp[i - 1][1];
if (dp[i - 1][0] != 0)
dp[i][1] = max(dp[i][1], 1 + dp[i - 1][0]);
}
else
dp[i][1] = dp[i - 1][1];
if (s[i] == 'i')
{
if (dp[i - 1][2] != 0)
dp[i][2] = 1 + dp[i - 1][2];
if (dp[i - 1][1] != 0)
dp[i][2] = max(dp[i][2], 1 + dp[i - 1][1]);
}
else
dp[i][2] = dp[i - 1][2];
if (s[i] == 'o')
{
if (dp[i - 1][3] != 0)
dp[i][3] = 1 + dp[i - 1][3];
if (dp[i - 1][2] != 0)
dp[i][3] = max(dp[i][3], 1 + dp[i - 1][2]);
}
else
dp[i][3] = dp[i - 1][3];
if (s[i] == 'u')
{
if (dp[i - 1][4] != 0)
dp[i][4] = 1 + dp[i - 1][4];
if (dp[i - 1][3] != 0)
dp[i][4] = max(dp[i][4], 1 + dp[i - 1][3]);
}
else
dp[i][4] = dp[i - 1][4];
}
cout << dp[n - 1][4];
return 0;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll t;
t = 1;
// cin>>t;
while (t--)
{
solve();
}
return 0;
}
//longest Vowel subsequence with ordered vowel โ
๐1
#include <iostream>
#include <vector>
#include <stack>
using namespace std;
vector<int> smallestLexicographicalSubsequence(vector<int>& hubs, int k) {
vector<int> result;
stack<int> st;
int n = hubs.size();
for (int i = 0; i < n; ++i) {
while (!st.empty() && st.top() > hubs[i] && st.size() + (n - i) > k) {
st.pop();
}
if (st.size() < k) {
st.push(hubs[i]);
}
}
while (!st.empty()) {
result.insert(result.begin(), st.top());
st.pop();
}
return result;
}
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Internship Opportunity
6 months Data Analyst Internship at Emittr
Batch : 2024 passouts
Link : send your resume and details at afreen.naz@emitrr.com
6 months Data Analyst Internship at Emittr
Batch : 2024 passouts
Link : send your resume and details at afreen.naz@emitrr.com
๐1
GlobalNodes Hiring Freshers !!
Role - Data Scientist - Freshers (0-1 year experience)
Location: [Gurugram]
Looking for passionate and motivated freshers to join the team as Data Scientists. The ideal candidates should have a strong foundation in data analysis, statistical methods, and machine learning. Familiarity with Python, R, and data visualization tools is a plus. This is a great opportunity to kick-start your career in data science with hands-on experience and mentorship.
Please email your resume at avijit.swain@globalnodes.ai
Role - Data Scientist - Freshers (0-1 year experience)
Location: [Gurugram]
Looking for passionate and motivated freshers to join the team as Data Scientists. The ideal candidates should have a strong foundation in data analysis, statistical methods, and machine learning. Familiarity with Python, R, and data visualization tools is a plus. This is a great opportunity to kick-start your career in data science with hands-on experience and mentorship.
Please email your resume at avijit.swain@globalnodes.ai
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name : Broadabridge
Role : Associate Technical Account Manager
Batch : 2024 passouts
Location : Mumbai
Link. : https://broadridge.wd5.myworkdayjobs.com/Careers/job/Mumbai---Supreme-Business-Park/Associate-Technical-Account-Manager_JR1065417
Role : Associate Technical Account Manager
Batch : 2024 passouts
Location : Mumbai
Link. : https://broadridge.wd5.myworkdayjobs.com/Careers/job/Mumbai---Supreme-Business-Park/Associate-Technical-Account-Manager_JR1065417
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Multiple Openings Available | 2023, 2024 Passouts
Trainee Software Engineer
Noida
10 openings
Send resume to HR :
Monali@omniesolutions.com
Trainee Software Engineer
Noida
10 openings
Send resume to HR :
Monali@omniesolutions.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company name: BluSmart
Role: Android Developer Intern
Batch Eligible: 2025 & 2026 passouts
Apply link :
https://www.linkedin.com/jobs/view/3988523412?original_referer=https%3A%2F%2Fperfleap.in%2F
Role: Android Developer Intern
Batch Eligible: 2025 & 2026 passouts
Apply link :
https://www.linkedin.com/jobs/view/3988523412?original_referer=https%3A%2F%2Fperfleap.in%2F
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Urban Company
Role: SDE 1
Batch eligible: 2024 grads
Apply: https://www.linkedin.com/jobs/view/3988233867
Role: SDE 1
Batch eligible: 2024 grads
Apply: https://www.linkedin.com/jobs/view/3988233867
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Cricbuzz.com is hiring Full Stack Developer
For 2021, 2022, 2023 grads
Location: Bangalore
https://www.linkedin.com/jobs/view/3978712961
For 2021, 2022, 2023 grads
Location: Bangalore
https://www.linkedin.com/jobs/view/3978712961
Linkedin
Cricbuzz.com hiring Full Stack Engineer in Bengaluru, Karnataka, India | LinkedIn
Posted 11:57:51 AM. We are seeking a talented Full Stack Developer with 1-2 years of experience in Node.js to join ourโฆSee this and similar jobs on LinkedIn.
int minimumCost(int input1, int input2, int input3, int **input4) {
int N = input1;
int M = input2;
int K = input3;
unordered_map<int, int> degree;
for (int i = 0; i < M; ++i) {
int u = input4[i][0];
int v = input4[i][1];
degree[u]++;
degree[v]++;
}
int count = 0;
for (const auto& pair : degree) {
if (pair.second > 1) {
count++;
}
}
return count * K;
}
Desmus and the Check Centersโ
int N = input1;
int M = input2;
int K = input3;
unordered_map<int, int> degree;
for (int i = 0; i < M; ++i) {
int u = input4[i][0];
int v = input4[i][1];
degree[u]++;
degree[v]++;
}
int count = 0;
for (const auto& pair : degree) {
if (pair.second > 1) {
count++;
}
}
return count * K;
}
Desmus and the Check Centersโ
SELECT
i.invoice_number,
c.customer_name,
COUNT(co.id) AS number_of_contacts
FROM
customer c
JOIN
invoice i ON c.id = i.customer_id
LEFT JOIN
contact co ON c.id = co.customer_id AND co.contact_start_time < i.invoice_date
LEFT JOIN
user_account ua ON co.user_account_id = ua.id
WHERE
i.user_account_id NOT IN (
SELECT DISTINCT user_account_id
FROM contact
WHERE customer_id = c.id AND contact_start_time < i.invoice_date
)
GROUP BY
i.id, c.id
ORDER BY
i.invoice_number ASC
๐1
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int minimumPower(vector<int>& cells) {
priority_queue<int, vector<int>, greater<int>> minHeap(cells.begin(), cells.end());
int totalPower = 0;
while (minHeap.size() > 1) {
int first = minHeap.top();
minHeap.pop();
int second = minHeap.top();
minHeap.pop();
int power = first + second;
totalPower += power;
minHeap.push(power);
}
return totalPower;
}
MINPOWERโ