Python 3โ
Tech Mahindra
Tech Mahindra
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int even = 0, odd = 0;
while (n > 0)
{
if ((n % 10) % 2 == 0)
even += n % 10;
else
odd += n % 10;
n = n / 10;
}
cout << even * odd;
}
C++โ
using namespace std;
int main()
{
int n;
cin >> n;
int even = 0, odd = 0;
while (n > 0)
{
if ((n % 10) % 2 == 0)
even += n % 10;
else
odd += n % 10;
n = n / 10;
}
cout << even * odd;
}
C++โ
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int k;
cin >> k;
sort(arr, arr + n);
cout << arr[k - 1];
}
C++โ
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int k;
cin >> k;
sort(arr, arr + n);
cout << arr[k - 1];
}
C++โ
Today Anyone give exam Texas instruments OA?
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Element5
Role: Software Tester Trainee
Batch eligible: 2022 and 2023 grads.
Apply: https://resources.e5.ai/careers/stt
P.S: Only go if you donโt have any offer till now.
Role: Software Tester Trainee
Batch eligible: 2022 and 2023 grads.
Apply: https://resources.e5.ai/careers/stt
P.S: Only go if you donโt have any offer till now.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Freshers, Full time, Part time all eligible.
If interested, send your resume at sourcing@upgrad.com
If interested, send your resume at sourcing@upgrad.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Stim is looking for a Full Stack Flutter Developer
https://docs.google.com/document/u/0/d/1Pd5mYQz6ULUI_Z2C0yUZrDJquOPi9TdxHEy6l2Th-TY/mobilebasic
https://docs.google.com/document/u/0/d/1Pd5mYQz6ULUI_Z2C0yUZrDJquOPi9TdxHEy6l2Th-TY/mobilebasic
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐ด Company:- CityBank
Job Role :- Java developer
Experienced Required : - 0 to 2 years
Eligibility : Bachelor Degree
Salary Range :- 7LPA to 15LPA+ (Depend upon Experience)
Job Location - Pune
โ๏ธ Apply Link : https://jobs.citi.com/job/-/-/287/51827863040
Job Role :- Java developer
Experienced Required : - 0 to 2 years
Eligibility : Bachelor Degree
Salary Range :- 7LPA to 15LPA+ (Depend upon Experience)
Job Location - Pune
โ๏ธ Apply Link : https://jobs.citi.com/job/-/-/287/51827863040
vvl tree;
vector<bool> todo, good;
void dfs(int v, int p = -1) {
for (int u : tree[v]) {
if (u != p) {
dfs(u, v);
if (todo[u]) {
todo[v] = true;
}
if (good[u]) {
good[v] = true;
}
}
}
}
long long findMinimumPathLength(ll n, vvl edges, vll visitNodes) {
tree = vector<vector<long long>>(n);
todo = vector<bool>(n);
good = vector<bool>(n);
for(long long i = 0; i < edges.size(); i++) {
tree[edges[i][0] - 1].push_back(edges[i][1] - 1);
tree[edges[i][1] - 1].push_back(edges[i][0] - 1);
}
for(long long i = 0; i < visitNodes.size(); i++) {
todo[visitNodes[i] - 1] = true;
}
good[n - 1] = true;
dfs(0);
long long ans = 0;
for(long long i = 0; i < n; i++) {
if(i == 0) continue;
if(good[i]) {
ans++;
}
else if(todo[i]) {
ans += 2;
}
}
return ans;
}
Nodes in a tree
vector<bool> todo, good;
void dfs(int v, int p = -1) {
for (int u : tree[v]) {
if (u != p) {
dfs(u, v);
if (todo[u]) {
todo[v] = true;
}
if (good[u]) {
good[v] = true;
}
}
}
}
long long findMinimumPathLength(ll n, vvl edges, vll visitNodes) {
tree = vector<vector<long long>>(n);
todo = vector<bool>(n);
good = vector<bool>(n);
for(long long i = 0; i < edges.size(); i++) {
tree[edges[i][0] - 1].push_back(edges[i][1] - 1);
tree[edges[i][1] - 1].push_back(edges[i][0] - 1);
}
for(long long i = 0; i < visitNodes.size(); i++) {
todo[visitNodes[i] - 1] = true;
}
good[n - 1] = true;
dfs(0);
long long ans = 0;
for(long long i = 0; i < n; i++) {
if(i == 0) continue;
if(good[i]) {
ans++;
}
else if(todo[i]) {
ans += 2;
}
}
return ans;
}
Nodes in a tree
def find_nearest_cities_3(x_cord, y_cord, city, query_cities):
def distance(x_y1, x_y2):
x1, y1 = x_y1
x2, y2 = x_y2
return abs(x2-x1) + abs(y2-y1)
def b_search_smallest(coord_city_list, target_coord, target_city):
start, end = 0, len(coord_city_list)-1
while(start<end):
mid = start + (end - start)//2
if coord_city_list[mid][0]>=target_coord:
end = mid
else:
start = mid+1
returning_city = coord_city_list[start][1]
if returning_city == query_city:
dis_around_query = float('inf')
if start>0:
dis_around_query = coord_city_list[start-1][0]
returning_city =coord_city_list[start-1][1]
if start<len(coord_city_list)-1 and coord_city_list[start+1][0]<=dis_around_query:
dis_around_query = coord_city_list[start+1][0]
returning_city =coord_city_list[start+1][1]
return returning_city
x_map, y_map, c_map = defaultdict(list), defaultdict(list), defaultdict()
for c, x, y in zip(city, x_cord, y_cord):
x_map[x].append((y, c))
y_map[y].append((x, c))
c_map[c]= (x, y)
for k in x_map.keys():
x_map[k].sort()
y_map[k].sort()
# print(x_map)
# print(y_map)
# print(c_map)
res = []
for query_city in query_cities:
if query_city not in c_map:
res.append(None)
else:
query_x, query_y = c_map[query_city]
city_near_x = b_search_smallest(x_map[query_x], query_y, query_city)
city_near_y = b_search_smallest(y_map[query_y], query_x, query_city)
if city_near_x == query_city and city_near_y == query_city:
res.append(None)
elif city_near_x == query_city:
res.append(city_near_y)
elif city_near_y == query_city:
res.append(city_near_x)
else:
dist1, dist2 = distance(c_map[query_city], c_map[city_near_x]), distance(c_map[query_city], c_map[city_near_y])
if dist1<dist2:
res.append(city_near_x)
else:
res.append(city_near_y)
return res
Nearest Neighboring City โ
def distance(x_y1, x_y2):
x1, y1 = x_y1
x2, y2 = x_y2
return abs(x2-x1) + abs(y2-y1)
def b_search_smallest(coord_city_list, target_coord, target_city):
start, end = 0, len(coord_city_list)-1
while(start<end):
mid = start + (end - start)//2
if coord_city_list[mid][0]>=target_coord:
end = mid
else:
start = mid+1
returning_city = coord_city_list[start][1]
if returning_city == query_city:
dis_around_query = float('inf')
if start>0:
dis_around_query = coord_city_list[start-1][0]
returning_city =coord_city_list[start-1][1]
if start<len(coord_city_list)-1 and coord_city_list[start+1][0]<=dis_around_query:
dis_around_query = coord_city_list[start+1][0]
returning_city =coord_city_list[start+1][1]
return returning_city
x_map, y_map, c_map = defaultdict(list), defaultdict(list), defaultdict()
for c, x, y in zip(city, x_cord, y_cord):
x_map[x].append((y, c))
y_map[y].append((x, c))
c_map[c]= (x, y)
for k in x_map.keys():
x_map[k].sort()
y_map[k].sort()
# print(x_map)
# print(y_map)
# print(c_map)
res = []
for query_city in query_cities:
if query_city not in c_map:
res.append(None)
else:
query_x, query_y = c_map[query_city]
city_near_x = b_search_smallest(x_map[query_x], query_y, query_city)
city_near_y = b_search_smallest(y_map[query_y], query_x, query_city)
if city_near_x == query_city and city_near_y == query_city:
res.append(None)
elif city_near_x == query_city:
res.append(city_near_y)
elif city_near_y == query_city:
res.append(city_near_x)
else:
dist1, dist2 = distance(c_map[query_city], c_map[city_near_x]), distance(c_map[query_city], c_map[city_near_y])
if dist1<dist2:
res.append(city_near_x)
else:
res.append(city_near_y)
return res
Nearest Neighboring City โ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Glance is Hiring for SDE1
Experience: 1-3 years
Expected CTC: 15-28 Lpa
Location: Bangalore
Apply here- https://www.glance.com/careers/5064943
Experience: 1-3 years
Expected CTC: 15-28 Lpa
Location: Bangalore
Apply here- https://www.glance.com/careers/5064943
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Flipkart is Hiring for #Data Analyst role for #Banglore
Exp- 1-2 yrs (freshers with good analytical skills can also be considered)
Skills - SQL, Tableau/Power BI, Advance Excel & Python
6 Days working(3 days wfh)
Send CV for referral: kaibalya.das@flipkart.com
Exp- 1-2 yrs (freshers with good analytical skills can also be considered)
Skills - SQL, Tableau/Power BI, Advance Excel & Python
6 Days working(3 days wfh)
Send CV for referral: kaibalya.das@flipkart.com
โค1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Zeta
Role: Android Developer
Batch eligible: 2022 and earlier grads
Apply: https://www.linkedin.com/jobs/view/3673185213
P.S: If you have 1 year of experience in Android development and looking for a switch, this is the best opportunity
Role: Android Developer
Batch eligible: 2022 and earlier grads
Apply: https://www.linkedin.com/jobs/view/3673185213
P.S: If you have 1 year of experience in Android development and looking for a switch, this is the best opportunity
Linkedin
Zeta hiring Android Developer in Bangalore Urban, Karnataka, India | LinkedIn
Posted 3:23:19 PM. What is the job like?Collaborate with cross-functional teams to define, design, and ship newโฆ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)
Company Name: RecruitCRM
Role: Trainee Software Engineer
Batch eligible: 2024 grads
Apply: https://bit.ly/recruitcrm2024hiring
Role: Trainee Software Engineer
Batch eligible: 2024 grads
Apply: https://bit.ly/recruitcrm2024hiring
RecruitCRM
Job Apply - Recruit CRM
Loading...
โค1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Xiaomi Ode2Code 3.0 ๐๐
๐๐ฅ๐ข๐ ๐ข๐๐ข๐ฅ๐ข๐ญ๐ฒ ๐๐ซ๐ข๐ญ๐๐ซ๐ข๐:
1. This competition is open to students pursuing B.Tech and M.Tech across ALL Engineering Colleges in India. (Batch of 2024, 2025 & 2026)
2. Students must register in teams of 1 to 2 members.
3. The participating students can be from any specialization, 4. Members of a team should be from the same Institute.
๐๐ซ๐จ๐๐๐ฌ๐ฌ:
1. Online Quiz 1 (August 14th, 2023)
2. Online Quiz 2 (August 17th, 2023)
3. Submission Round (August 21st, 2023)
4. Finale
https://unstop.com/competitions/xiaomi-ode2code-30-xiaomi-india-713806?lb=VM0FqwL&utm_medium=Share&utm_source=shortUrl
๐๐ฅ๐ข๐ ๐ข๐๐ข๐ฅ๐ข๐ญ๐ฒ ๐๐ซ๐ข๐ญ๐๐ซ๐ข๐:
1. This competition is open to students pursuing B.Tech and M.Tech across ALL Engineering Colleges in India. (Batch of 2024, 2025 & 2026)
2. Students must register in teams of 1 to 2 members.
3. The participating students can be from any specialization, 4. Members of a team should be from the same Institute.
๐๐ซ๐จ๐๐๐ฌ๐ฌ:
1. Online Quiz 1 (August 14th, 2023)
2. Online Quiz 2 (August 17th, 2023)
3. Submission Round (August 21st, 2023)
4. Finale
https://unstop.com/competitions/xiaomi-ode2code-30-xiaomi-india-713806?lb=VM0FqwL&utm_medium=Share&utm_source=shortUrl
Unstop
Unstop - Competitions, Quizzes, Hackathons, Scholarships and Internships for Students and
Corporates
Corporates
Explore student/corporate competitions & engagements for B-schools, Engineering & Graduate colleges. We are an employer branding consultant & help conceptualize & organize these engagements | Unstop (formerly Dare2Compete) - India
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Barclays Hiring HTD BI Graduate Analyst
Only 2024 Batch
https://search.jobs.barclays/job/mumbai/htd-bi-graduate-analyst-2024-eg/13015/52047815488
Only 2024 Batch
https://search.jobs.barclays/job/mumbai/htd-bi-graduate-analyst-2024-eg/13015/52047815488
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Criteo is hiring Interns
For 2022/2023 Grads
https://careers.criteo.com/en/jobs/r16859/intern-adops/?source=LinkedInJobBoard
For 2022/2023 Grads
https://careers.criteo.com/en/jobs/r16859/intern-adops/?source=LinkedInJobBoard
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
bool prime[100005];
int dp[100005];
ll answer;
bool visited[100005];
vector<int> adjacent[100005];
void dfs1(int u) {
visited[u] = true;
int sum = prime[u] ? 0 : 1;
for (int i = 0; i < adjacent[u].size(); i++) {
int v = adjacent[u][i];
if (!visited[v]) {
dfs1(v);
sum += dp[v];
}
}
dp[u] = sum;
if (prime[u]) dp[u] = 0;
}
void dfs2(int u, int p, int dv) {
visited[u] = true;
if (prime[u]) {
vector<ll> pp;
ll sum = dv;
pp.push_back(dv);
for (int i = 0; i < adjacent[u].size(); i++) {
int v = adjacent[u][i];
if (!visited[v] && v != p) {
dfs2(v, u, 0);
pp.push_back(dp[v]);
sum += dp[v];
}
}
ll val = 0;
for (int i = 0; i < pp.size(); i++) {
val += (sum - pp[i]) * pp[i];
}
val /= 2;
answer += val;
answer += sum;
} else {
for (int i = 0; i < adjacent[u].size(); i++) {
int v = adjacent[u][i];
if (!visited[v] && v != p) {
dfs2(v, u, dv + dp[u] - dp[v]);
}
}
}
}
void Sieve() {
for (int i = 1; i <= 100000; i++) {
prime[i] = true;
}
prime[1] = false;
for (int i = 2; i * i <= 100000; i++) {
if (prime[i]) {
for (int j = i * i; j <= 100000; j += i) {
prime[j] = false;
}
}
}
}
int main() {
Sieve();
int n;
cin >> n;
assert(1 <= n && n <= 100000);
for (int i = 0; i < n - 1; i++) {
int u, v;
cin >> u >> v;
assert(1 <= u && u <= n);
assert(1 <= v && v <= n);
adjacent[u].push_back(v);
adjacent[v].push_back(u);
}
dfs1(1);
for (int i = 1; i <= n; i++) visited[i] = false;
dfs2(1, 0, 0);
cout << answer << endl;
}
Sprinklr โ
(Search Engine)
#define ll long long int
using namespace std;
bool prime[100005];
int dp[100005];
ll answer;
bool visited[100005];
vector<int> adjacent[100005];
void dfs1(int u) {
visited[u] = true;
int sum = prime[u] ? 0 : 1;
for (int i = 0; i < adjacent[u].size(); i++) {
int v = adjacent[u][i];
if (!visited[v]) {
dfs1(v);
sum += dp[v];
}
}
dp[u] = sum;
if (prime[u]) dp[u] = 0;
}
void dfs2(int u, int p, int dv) {
visited[u] = true;
if (prime[u]) {
vector<ll> pp;
ll sum = dv;
pp.push_back(dv);
for (int i = 0; i < adjacent[u].size(); i++) {
int v = adjacent[u][i];
if (!visited[v] && v != p) {
dfs2(v, u, 0);
pp.push_back(dp[v]);
sum += dp[v];
}
}
ll val = 0;
for (int i = 0; i < pp.size(); i++) {
val += (sum - pp[i]) * pp[i];
}
val /= 2;
answer += val;
answer += sum;
} else {
for (int i = 0; i < adjacent[u].size(); i++) {
int v = adjacent[u][i];
if (!visited[v] && v != p) {
dfs2(v, u, dv + dp[u] - dp[v]);
}
}
}
}
void Sieve() {
for (int i = 1; i <= 100000; i++) {
prime[i] = true;
}
prime[1] = false;
for (int i = 2; i * i <= 100000; i++) {
if (prime[i]) {
for (int j = i * i; j <= 100000; j += i) {
prime[j] = false;
}
}
}
}
int main() {
Sieve();
int n;
cin >> n;
assert(1 <= n && n <= 100000);
for (int i = 0; i < n - 1; i++) {
int u, v;
cin >> u >> v;
assert(1 <= u && u <= n);
assert(1 <= v && v <= n);
adjacent[u].push_back(v);
adjacent[v].push_back(u);
}
dfs1(1);
for (int i = 1; i <= n; i++) visited[i] = false;
dfs2(1, 0, 0);
cout << answer << endl;
}
Sprinklr โ
(Search Engine)