๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
int fun(int node, int parent, vector<vector<int> >&adj, vector<int>&weight, int &maxi)
{
int sum1 = 0;
for(auto it:adj[node])
{
if(it != parent)
{
sum1 += fun(it,node,adj,weight,maxi);
}
}
sum1 = max(sum1,weight[node-1]);
maxi = max(maxi,sum1);
return sum1;
}
int findMaximumSum(int tree_nodes, vector<int> tree_from, vector<int> tree_to, vector<int> weight)
{
int n = tree_nodes;
vector<vector<int> > adj(n+1);
for(int i = 0; i<tree_from.size(); i++)
{
adj[tree_from[i]].push_back(tree_to[i]);
adj[tree_to[i]].push_back(tree_from[i]);
}
int maxi = -1e9;
fun(1,-1,adj,weight,maxi);
return maxi;
}
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
๐ Attention 2025 Grads! Join Xeno as an SDE Intern! ๐
We're hiring SDEโฆ | Aarushi Chawla | 39 comments
We're hiring SDEโฆ | Aarushi Chawla | 39 comments
๐ Attention 2025 Grads! Join Xeno as an SDE Intern! ๐
We're hiring SDE interns for a 6-month internship starting January 2025 in Delhi. This hybrid role requires 2-3 days in office per week โ a fantastic chance to gain hands-on experience with our talentedโฆ
We're hiring SDE interns for a 6-month internship starting January 2025 in Delhi. This hybrid role requires 2-3 days in office per week โ a fantastic chance to gain hands-on experience with our talentedโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐NTTData Hiring
Role: Associate Platform Security Engineer
Salary: 4 - 7 LPA
Skills: Firewall, IDS, IPS, Security Technology, Fundamentals
๐ปApply Link: https://tinyurl.com/securityAssociateEngineer
For Cybersecurity Enthusiasts
Role: Associate Platform Security Engineer
Salary: 4 - 7 LPA
Skills: Firewall, IDS, IPS, Security Technology, Fundamentals
๐ปApply Link: https://tinyurl.com/securityAssociateEngineer
For Cybersecurity Enthusiasts
โค1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Linkedin
Google Forms: Sign-in | Rohit Awasthi | 42 comments
Hiring an Asst. Manager for my team in Flipkart !
Job role- Data Analytics and Planning in category
An ideal candidate would have strong Excel and data analysis skills with 0-2 years of experience.
Location- Bangalore (Work from office)
Interested candidatesโฆ
Job role- Data Analytics and Planning in category
An ideal candidate would have strong Excel and data analysis skills with 0-2 years of experience.
Location- Bangalore (Work from office)
Interested candidatesโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Infraveo Technologies is hiring for Fullstack Developer (Frontend)
Experience: 0-1 years
Apply here: https://www.linkedin.com/jobs/view/fullstack-developer-frontend-at-infraveo-technologies-4073943384/
Experience: 0-1 years
Apply here: https://www.linkedin.com/jobs/view/fullstack-developer-frontend-at-infraveo-technologies-4073943384/
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Ismartrecruit
<p><strong>What we offer:</strong></p>
<ul>
<li><strong>6 Months Internship followed with job opportunity</strong></li>
โฆ
<ul>
<li><strong>6 Months Internship followed with job opportunity</strong></li>
โฆ
What we offer:
6 Months Internship followed with job opportunity
Hands-on training and mentorship from industry experts.
Opportunity to work on live projects and client interactions.
A vibrant and learning-driven work culture.
5 days a weekโฆ
6 Months Internship followed with job opportunity
Hands-on training and mentorship from industry experts.
Opportunity to work on live projects and client interactions.
A vibrant and learning-driven work culture.
5 days a weekโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Flutter Internship Application form
https://docs.google.com/forms/d/e/1FAIpQLSfAeQa1raoh7Ci5jBY85CDrJ0WzZk5qTxRjvkzfHPyn5BNf3Q/viewform
https://docs.google.com/forms/d/e/1FAIpQLSfAeQa1raoh7Ci5jBY85CDrJ0WzZk5qTxRjvkzfHPyn5BNf3Q/viewform
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Vance (YC W22) is hiring for Frontend Engineering Intern
Experience: 0-1 year's
Expected Stipend: 5-7 LPA
Apply here: https://www.linkedin.com/jobs/view/frontend-engineering-intern-at-vance-yc-w22-4075138175/?originalSubdomain=in
Experience: 0-1 year's
Expected Stipend: 5-7 LPA
Apply here: https://www.linkedin.com/jobs/view/frontend-engineering-intern-at-vance-yc-w22-4075138175/?originalSubdomain=in
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
#fresher looking for data science and data engineering roles, please send your resume with a brief introduction of your skills and strengths to ๐ priya1.sharma@infogain.com, c to neelima.trehan@infogain.com. Good opportunity in a tough market!!
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐Nutanix Hiring !!
Role - SDET
Experience: 0 to 1 year
Expected CTC- 24 to 30 LPA
๐ปApply Link: https://careers.nutanix.com/en/jobs/27886/sdet-automation-0-1-years/
Role - SDET
Experience: 0 to 1 year
Expected CTC- 24 to 30 LPA
๐ปApply Link: https://careers.nutanix.com/en/jobs/27886/sdet-automation-0-1-years/
Nutanix Careers
SDET- Automation [ 0-1 years]
Hungry, Humble, Honest, with Heart. The Opportunity We are looking for engineers who are passionate about working on scalable distributed systems. You will be part of the Nutanix Cassandra team, which owns the metadata part of the Nutanix Storage Virtualization.โฆ
๐2
vector<int> countVisibleTowers(vector<int>& height) {
int n = height.size();
vector<int> visible(n, 0);
stack<int> s;
for (int i = 0; i < n; ++i) {
visible[i] += s.size();
while (!s.empty() && height[s.top()] <= height[i]) {
s.pop();
}
s.push(i);
}
while (!s.empty()) s.pop();
for (int i = n - 1; i >= 0; --i) {
visible[i] += s.size();
while (!s.empty() && height[s.top()] <= height[i]) {
s.pop();
}
s.push(i);
}
return visible;
}
Rippling โ
๐1
#include <iostream>
using namespace std;
const int MOD = 1000000007;
long countWays(int n) {
long long dp[100001][2] = {0};
dp[1][0] = 1;
dp[1][1] = 0;
if(n >= 2) {
dp[2][0] = 1;
dp[2][1] = 1;
}
for(int i = 3; i <= n; i++) {
dp[i][0] = (dp[i-1][0] + dp[i-1][1]) % MOD;
dp[i][1] = dp[i-2][0] % MOD;
}
return (dp[n][0] + dp[n][1]) % MOD;
}
int main() {
int n;
cin >> n;
cout << countWays(n) << endl;
return 0;
}
Vimo โ
using namespace std;
const int MOD = 1000000007;
long countWays(int n) {
long long dp[100001][2] = {0};
dp[1][0] = 1;
dp[1][1] = 0;
if(n >= 2) {
dp[2][0] = 1;
dp[2][1] = 1;
}
for(int i = 3; i <= n; i++) {
dp[i][0] = (dp[i-1][0] + dp[i-1][1]) % MOD;
dp[i][1] = dp[i-2][0] % MOD;
}
return (dp[n][0] + dp[n][1]) % MOD;
}
int main() {
int n;
cin >> n;
cout << countWays(n) << endl;
return 0;
}
Vimo โ
๐1๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Antino is Hiring!
Are you looking for a challenging and rewarding career where you can make a real impact?
We're seeking fresh talent for the following internship positions:
HR Intern: https://lnkd.in/gqnizVXY
Account Intern:https://lnkd.in/gd6mmdMz
Motion Graphic Intern:https://lnkd.in/gMzMvSAe
Business Development Intern:https://lnkd.in/gPaiGZ53
Job Locations: Gurgaon/Bangalore
Are you looking for a challenging and rewarding career where you can make a real impact?
We're seeking fresh talent for the following internship positions:
HR Intern: https://lnkd.in/gqnizVXY
Account Intern:https://lnkd.in/gd6mmdMz
Motion Graphic Intern:https://lnkd.in/gMzMvSAe
Business Development Intern:https://lnkd.in/gPaiGZ53
Job Locations: Gurgaon/Bangalore
lnkd.in
LinkedIn
This link will take you to a page thatโs not on LinkedIn
#include <bits/stdc++.h>
#define ll long long
using namespace std;
string mergePalindrome(string&a,string&b)
{
ll n=a.length();
ll m=b.length();
unordered_map<char,ll> m1,m2;
for(char it:a) m1[it]++;
for(char it:b) m2[it]++;
string mid="",ans="";
for (char i='a';i<='z';i++)
{
if(m1[i]%2 and m2[i]%2 and mid.length()<=1) mid=string(2,i);
if((m1[i]%2 or m2[i]%2) and mid.length()==0) mid=i;
ans+=string((m1[i]/2+m2[i]/2),i);
}
string tt=ans;
if (mid.length()==2)
{
tt+=mid[0];
ans+=mid[0];
sort(begin(ans),end(ans));
tt=ans+string(rbegin(ans),rend(ans));
}
else tt+=mid+string(rbegin(ans),rend(ans));
return tt;
}
signed main()
{
string s,t; cin>>s>>t;
cout<<solve(s,t);
return 0;
}
Merging palindromes โ
#define ll long long
using namespace std;
string mergePalindrome(string&a,string&b)
{
ll n=a.length();
ll m=b.length();
unordered_map<char,ll> m1,m2;
for(char it:a) m1[it]++;
for(char it:b) m2[it]++;
string mid="",ans="";
for (char i='a';i<='z';i++)
{
if(m1[i]%2 and m2[i]%2 and mid.length()<=1) mid=string(2,i);
if((m1[i]%2 or m2[i]%2) and mid.length()==0) mid=i;
ans+=string((m1[i]/2+m2[i]/2),i);
}
string tt=ans;
if (mid.length()==2)
{
tt+=mid[0];
ans+=mid[0];
sort(begin(ans),end(ans));
tt=ans+string(rbegin(ans),rend(ans));
}
else tt+=mid+string(rbegin(ans),rend(ans));
return tt;
}
signed main()
{
string s,t; cin>>s>>t;
cout<<solve(s,t);
return 0;
}
Merging palindromes โ
๐1
#include <bits/stdc++.h>
using namespace std;
#define loop(i, a, n) for (lli i = (a); i < (n); ++i)
#define loopD(i, a, n) for (lli i = (a); i >= (n); --i)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define sz(a) ((lli)a.size())
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define endl '\n'
#define fastio std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define pb push_back
#define pp pop_back()
#define fi first
#define si second
#define v(a) vector<int>(a)
#define vv(a) vector<vector<int>>(a)
#define present(c, x) ((c).find(x) != (c).end())
#define set_bits __builtin_popcountll
#define MOD 1000000007
#define int long long
typedef long long lli;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<lli, lli> pll;
typedef pair<int, int> pii;
typedef unordered_map<int, int> umpi;
typedef map<int, int> mpi;
typedef vector<pii> vp;
typedef vector<lli> vll;
typedef vector<vll> vvll;
struct Line {
int x1, y1, x2, y2;
bool vertical() const { return x1 == x2; }
bool horizontal() const { return y1 == y2; }
bool diagonal() const { return abs(x2 - x1) == abs(y2 - y1); }
};
int N, K;
vector<Line> lines;
map<pair<int, int>, vector<int>> ptsMap;
void add(const Line& line, int idx) {
int x1 = line.x1, y1 = line.y1;
int x2 = line.x2, y2 = line.y2;
if (line.vertical()) {
int yStart = min(y1, y2);
int yEnd = max(y1, y2);
for(int y = yStart; y <= yEnd; y++) {
ptsMap[{x1, y}].push_back(idx);
}
}
else if (line.horizontal()) {
int xStart = min(x1, x2);
int xEnd = max(x1, x2);
for(int x = xStart; x <= xEnd; x++) {
ptsMap[{x, y1}].push_back(idx);
}
}
else if (line.diagonal()) {
int steps = abs(x2 - x1);
int dx = (x2 - x1) / steps;
int dy = (y2 - y1) / steps;
for(int i = 0; i <= steps; i++) {
int x = x1 + i * dx;
int y = y1 + i * dy;
ptsMap[{x, y}].push_back(idx);
}
}
}
int ff(int x1, int y1, int x2, int y2) {
if(x1 == x2) return abs(y1 - y2);
if(y1 == y2) return abs(x1 - x2);
if(abs(x1 - x2) == abs(y1 - y2)) return abs(x1 - x2);
return 0;
}
int solve(const pair<int, int>& pt, const vector<int>& lst) {
vector<int> d;
for(auto lIdx : lst) {
const Line& ln = lines[lIdx];
bool oneSided = (pt.first == ln.x1 && pt.second == ln.y1) ||
(pt.first == ln.x2 && pt.second == ln.y2);
if(oneSided) {
int ex = (pt.first == ln.x1 && pt.second == ln.y1) ? ln.x2 : ln.x1;
int ey = (pt.first == ln.x1 && pt.second == ln.y1) ? ln.y2 : ln.y1;
d.push_back(ff(pt.first, pt.second, ex, ey));
}
else {
d.push_back(ff(pt.first, pt.second, ln.x1, ln.y1));
d.push_back(ff(pt.first, pt.second, ln.x2, ln.y2));
}
}
return d.empty() ? 0 : *min_element(d.begin(), d.end());
}
void solve() {
cin >> N;
lines.resize(N);
for(int i = 0; i < N; i++) {
cin >> lines[i].x1 >> lines[i].y1 >> lines[i].x2 >> lines[i].y2;
add(lines[i], i);
}
cin >> K;
int total = 0;
for(auto &[pt, lst] : ptsMap) {
if(sz(lst) == K) {
total += solve(pt, lst);
}
}
cout << total << "\n";
}
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
solve();
return 0;
}
Magic Stars โ
TCS Codevita
Source : ishaan
using namespace std;
#define loop(i, a, n) for (lli i = (a); i < (n); ++i)
#define loopD(i, a, n) for (lli i = (a); i >= (n); --i)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define sz(a) ((lli)a.size())
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define endl '\n'
#define fastio std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define pb push_back
#define pp pop_back()
#define fi first
#define si second
#define v(a) vector<int>(a)
#define vv(a) vector<vector<int>>(a)
#define present(c, x) ((c).find(x) != (c).end())
#define set_bits __builtin_popcountll
#define MOD 1000000007
#define int long long
typedef long long lli;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<lli, lli> pll;
typedef pair<int, int> pii;
typedef unordered_map<int, int> umpi;
typedef map<int, int> mpi;
typedef vector<pii> vp;
typedef vector<lli> vll;
typedef vector<vll> vvll;
struct Line {
int x1, y1, x2, y2;
bool vertical() const { return x1 == x2; }
bool horizontal() const { return y1 == y2; }
bool diagonal() const { return abs(x2 - x1) == abs(y2 - y1); }
};
int N, K;
vector<Line> lines;
map<pair<int, int>, vector<int>> ptsMap;
void add(const Line& line, int idx) {
int x1 = line.x1, y1 = line.y1;
int x2 = line.x2, y2 = line.y2;
if (line.vertical()) {
int yStart = min(y1, y2);
int yEnd = max(y1, y2);
for(int y = yStart; y <= yEnd; y++) {
ptsMap[{x1, y}].push_back(idx);
}
}
else if (line.horizontal()) {
int xStart = min(x1, x2);
int xEnd = max(x1, x2);
for(int x = xStart; x <= xEnd; x++) {
ptsMap[{x, y1}].push_back(idx);
}
}
else if (line.diagonal()) {
int steps = abs(x2 - x1);
int dx = (x2 - x1) / steps;
int dy = (y2 - y1) / steps;
for(int i = 0; i <= steps; i++) {
int x = x1 + i * dx;
int y = y1 + i * dy;
ptsMap[{x, y}].push_back(idx);
}
}
}
int ff(int x1, int y1, int x2, int y2) {
if(x1 == x2) return abs(y1 - y2);
if(y1 == y2) return abs(x1 - x2);
if(abs(x1 - x2) == abs(y1 - y2)) return abs(x1 - x2);
return 0;
}
int solve(const pair<int, int>& pt, const vector<int>& lst) {
vector<int> d;
for(auto lIdx : lst) {
const Line& ln = lines[lIdx];
bool oneSided = (pt.first == ln.x1 && pt.second == ln.y1) ||
(pt.first == ln.x2 && pt.second == ln.y2);
if(oneSided) {
int ex = (pt.first == ln.x1 && pt.second == ln.y1) ? ln.x2 : ln.x1;
int ey = (pt.first == ln.x1 && pt.second == ln.y1) ? ln.y2 : ln.y1;
d.push_back(ff(pt.first, pt.second, ex, ey));
}
else {
d.push_back(ff(pt.first, pt.second, ln.x1, ln.y1));
d.push_back(ff(pt.first, pt.second, ln.x2, ln.y2));
}
}
return d.empty() ? 0 : *min_element(d.begin(), d.end());
}
void solve() {
cin >> N;
lines.resize(N);
for(int i = 0; i < N; i++) {
cin >> lines[i].x1 >> lines[i].y1 >> lines[i].x2 >> lines[i].y2;
add(lines[i], i);
}
cin >> K;
int total = 0;
for(auto &[pt, lst] : ptsMap) {
if(sz(lst) == K) {
total += solve(pt, lst);
}
}
cout << total << "\n";
}
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
solve();
return 0;
}
Magic Stars โ
TCS Codevita
Source : ishaan
๐2