๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode* next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
SinglyLinkedListNode* findLongestList(SinglyLinkedListNode* head) {
if (!head) return nullptr;
SinglyLinkedListNode* curr = head;
SinglyLinkedListNode* start = head;
SinglyLinkedListNode* bestStart = head;
int length = 1;
int bestLength = 1;
while (curr->next) {
if (curr->data >= curr->next->data) {
length++;
} else {
if (length > bestLength) {
bestLength = length;
bestStart = start;
}
length = 1;
start = curr->next;
}
curr = curr->next;
}
// Check at the end in case the best sub-list is at the very end.
if (length > bestLength) {
bestLength = length;
bestStart = start;
}
// Truncate the list after the longest non-increasing sub-list
SinglyLinkedListNode* temp = bestStart;
for (int i = 1; i < bestLength && temp; i++) {
temp = temp->next;
}
if (temp) {
temp->next = nullptr;
}
return bestStart;
}
C++โ
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode* next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
SinglyLinkedListNode* findLongestList(SinglyLinkedListNode* head) {
if (!head) return nullptr;
SinglyLinkedListNode* curr = head;
SinglyLinkedListNode* start = head;
SinglyLinkedListNode* bestStart = head;
int length = 1;
int bestLength = 1;
while (curr->next) {
if (curr->data >= curr->next->data) {
length++;
} else {
if (length > bestLength) {
bestLength = length;
bestStart = start;
}
length = 1;
start = curr->next;
}
curr = curr->next;
}
// Check at the end in case the best sub-list is at the very end.
if (length > bestLength) {
bestLength = length;
bestStart = start;
}
// Truncate the list after the longest non-increasing sub-list
SinglyLinkedListNode* temp = bestStart;
for (int i = 1; i < bestLength && temp; i++) {
temp = temp->next;
}
if (temp) {
temp->next = nullptr;
}
return bestStart;
}
C++โ
#include<bits/stdc++.h>
using namespace std;
vector<int> getMeanRankCount(vector<int>& rank) {
int n = rank.size();
vector<long long> prefixSum(n + 1, 0);
for (int i = 0; i < n; ++i) {
prefixSum[i + 1] = prefixSum[i] + rank[i];
}
vector<int> res(n, 0);
for (int i = 0; i < n; ++i) {
for (int j = i; j < n; ++j) {
long long sum = prefixSum[j + 1] - prefixSum[i];
long long len = j - i + 1;
if (sum % len == 0) {
long long mean = sum / len;
if (mean <= n) {
res[mean - 1]++;
}
}
}
}
return res;
}
int main() {
vector<int> ranks = {4,7,3,6,5,2,1};
vector<int> result = getMeanRankCount(ranks);
for (int val : result) {
cout << val << " ";
}
return 0;
}
Amazon C++โ
using namespace std;
vector<int> getMeanRankCount(vector<int>& rank) {
int n = rank.size();
vector<long long> prefixSum(n + 1, 0);
for (int i = 0; i < n; ++i) {
prefixSum[i + 1] = prefixSum[i] + rank[i];
}
vector<int> res(n, 0);
for (int i = 0; i < n; ++i) {
for (int j = i; j < n; ++j) {
long long sum = prefixSum[j + 1] - prefixSum[i];
long long len = j - i + 1;
if (sum % len == 0) {
long long mean = sum / len;
if (mean <= n) {
res[mean - 1]++;
}
}
}
}
return res;
}
int main() {
vector<int> ranks = {4,7,3,6,5,2,1};
vector<int> result = getMeanRankCount(ranks);
for (int val : result) {
cout << val << " ";
}
return 0;
}
Amazon C++โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include<bits/stdc++.h>
using namespace std;
vector<int> twoDimensions(vector<string> coordinates, int n) {
vector<int> maxAndCount(2);
vector<vector<int>> grid(n, vector<int>(n, 0));
int arrLength = coordinates.size();
int max_val = INT_MIN;
int count = 1;
for (int i = 0; i < arrLength; i++) {
stringstream ss(coordinates[i]);
int row, column;
ss >> row >> column;
for (int j = 0; j < row; j++) {
for (int k = 0; k < column; k++) {
grid[j][k] += 1;
if (grid[j][k] > max_val) {
max_val = grid[j][k];
count = 1;
} else if (grid[j][k] == max_val) {
count++;
}
}
}
}
maxAndCount[0] = max_val;
maxAndCount[1] = count;
return maxAndCount;
}
int main() {
vector<string> coors = { "2 3", "3 7", "4 1"};
vector<int> result = twoDimensions(coors, 7); // Change 3 to 7 for the grid size
cout <<result[1] << endl;
return 0;
}
Oracle โ
Growth in 2 Dimension
using namespace std;
vector<int> twoDimensions(vector<string> coordinates, int n) {
vector<int> maxAndCount(2);
vector<vector<int>> grid(n, vector<int>(n, 0));
int arrLength = coordinates.size();
int max_val = INT_MIN;
int count = 1;
for (int i = 0; i < arrLength; i++) {
stringstream ss(coordinates[i]);
int row, column;
ss >> row >> column;
for (int j = 0; j < row; j++) {
for (int k = 0; k < column; k++) {
grid[j][k] += 1;
if (grid[j][k] > max_val) {
max_val = grid[j][k];
count = 1;
} else if (grid[j][k] == max_val) {
count++;
}
}
}
}
maxAndCount[0] = max_val;
maxAndCount[1] = count;
return maxAndCount;
}
int main() {
vector<string> coors = { "2 3", "3 7", "4 1"};
vector<int> result = twoDimensions(coors, 7); // Change 3 to 7 for the grid size
cout <<result[1] << endl;
return 0;
}
Oracle โ
Growth in 2 Dimension
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
int64_t total_execution_time(vector<int> execution)
{
const auto n = execution.size();
map<int, int> div;
int64_t tot = 0;
for (auto tm : execution) {
if (!mp.count(tm)) {
mp[tm] = (tm + 1) / 2;
tot += tm;
} else {
tot += mp[tm];
mp[tm]=(mp[tm] + 1) / 2;
}
}
return tot;
}
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Bright Money hiring intern(SDE)
Qualification :Currently, Pursuing their Bachelors or Masters in Computer Science or Information Science and should be available for 6 months full time internship
Apply Link :
https://www.linkedin.com/jobs/view/3693678003/
Qualification :Currently, Pursuing their Bachelors or Masters in Computer Science or Information Science and should be available for 6 months full time internship
Apply Link :
https://www.linkedin.com/jobs/view/3693678003/
Linkedin
40 Software Engineer Intern jobs in India (2 new)
Todayโs top 40 Software Engineer Intern jobs in India. Leverage your professional network, and get hired. New Software Engineer Intern jobs added daily.
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Software developer at PlusWealth Capital Management LLP
Experience: 0-5 years
Location: Noida/Gurgaon
HFT or FinTech experience preferred.
Share your resume at recruiter@pluswealth.net
linkedin - https://tinyurl.com/45exj62d
Experience: 0-5 years
Location: Noida/Gurgaon
HFT or FinTech experience preferred.
Share your resume at recruiter@pluswealth.net
linkedin - https://tinyurl.com/45exj62d
Linkedin
Sanket Singh on LinkedIn: #hiring #hiringalerts #softwareengineerjobs #python #c #noidajobsโฆ | 13 comments
Hiring !!!
Software developer at PlusWealth Capital Management LLP
Experience: 0-5 years
Location: Noida/Gurgaon
HFT or FinTech experience preferred.
Shareโฆ | 13 comments on LinkedIn
Software developer at PlusWealth Capital Management LLP
Experience: 0-5 years
Location: Noida/Gurgaon
HFT or FinTech experience preferred.
Shareโฆ | 13 comments on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
https://www.linkedin.com/posts/stephen-raj-b9002185_requirement-for-samsung-production-team-activity-7096357934795812864-lxai?utm_source=share&utm_medium=member_android
Samsung hiring 2023 Grads
Samsung hiring 2023 Grads
Linkedin
Stephen Raj on LinkedIn: Requirement for Samsung Production Team:
1. Position: Graduate Engineerโฆ | 139 comments
1. Position: Graduate Engineerโฆ | 139 comments
Requirement for Samsung Production Team:
1. Position: Graduate Engineer Trainee
No of positions: 03
Qualification: BE (EEE/EIE)
Preference: Male
Passed outโฆ | 139 comments on LinkedIn
1. Position: Graduate Engineer Trainee
No of positions: 03
Qualification: BE (EEE/EIE)
Preference: Male
Passed outโฆ | 139 comments on LinkedIn
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Amazon Hiring SDE Intern
Location - Sydney, Australia
https://www.amazon.jobs/en-gb/jobs/2407108/2023-system-development-engineer-intern
Location - Sydney, Australia
https://www.amazon.jobs/en-gb/jobs/2407108/2023-system-development-engineer-intern
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Amazon software dev engineer intern role hiring
2023/2024 grads
https://www.amazon.jobs/en/jobs/2415936/software-dev-engineer-intern
2023/2024 grads
https://www.amazon.jobs/en/jobs/2415936/software-dev-engineer-intern
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
๐๐๐๐๐ ๐๐๐๐๐๐
โขPosition : Data Analytics โ Data Science
โขType : Internship
โขLocation : Mumbai, Maharashtra
โขExp : 0 Yrs (Freshers)
Apply ๐:-
https://ketto.keka.com/careers/jobdetails/44562?source=geeksgod
โขPosition : Data Analytics โ Data Science
โขType : Internship
โขLocation : Mumbai, Maharashtra
โขExp : 0 Yrs (Freshers)
Apply ๐:-
https://ketto.keka.com/careers/jobdetails/44562?source=geeksgod
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: SmartReach.io
Role: SDE 1
Batch eligible: 2022 and 2023 grads
Apply: https://www.linkedin.com/jobs/view/3690540154
Role: SDE 1
Batch eligible: 2022 and 2023 grads
Apply: https://www.linkedin.com/jobs/view/3690540154
Linkedin
SmartReach.io hiring Software Development Engineer - 1 in India | LinkedIn
Posted 7:39:40 AM. Location: Remote (this is a full-time position)Experience: You are a Fresher (i.e. you graduatedโฆ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)
โ๏ธ Spikewell off Campus Drive 2023 | SDE | Rs 20K Per Month โ๏ธ
๐จโ๐ปJob Role : SDE
๐Qualification : B-tech in CSE & IT/BCA/MCA
๐Batch : 2023
๐ฐSalary : 20K Per Month
https://spikewell.zohorecruit.in/jobs/Careers/62862000001510001/SDE-Intern?
๐จโ๐ปJob Role : SDE
๐Qualification : B-tech in CSE & IT/BCA/MCA
๐Batch : 2023
๐ฐSalary : 20K Per Month
https://spikewell.zohorecruit.in/jobs/Careers/62862000001510001/SDE-Intern?
Happy Independence day Everyone ๐ฎ๐ณ๐ฉ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company Name: Rezo
Role: Software Engineer
Batch eligible: 2022 and 2023 grads
Apply: https://rezo.keka.com/careers/jobdetails/44601?source=linkedin
Role: Software Engineer
Batch eligible: 2022 and 2023 grads
Apply: https://rezo.keka.com/careers/jobdetails/44601?source=linkedin
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
NCR Hiring Intern !!
Role - SDE
https://ncr.wd1.myworkdayjobs.com/en-US/ext_apac/job/Intern---Software_R0133946
Role - SDE
https://ncr.wd1.myworkdayjobs.com/en-US/ext_apac/job/Intern---Software_R0133946
from queue import Queue
def solution(N, A, B, M):
degree = [0] * N
for i in range(M):
degree[A[i]] += 1
degree[B[i]] += 1
q = Queue()
for i in range(N):
if degree[i] <= 1:
q.put(i)
seconds = 0
while not q.empty():
q_size = q.qsize()
for i in range(q_size):
vertex = q.get()
for j in range(M):
if A[j] == vertex or B[j] == vertex:
other_vertex = B[j] if A[j] == vertex else A[j]
degree[other_vertex] -= 1
if degree[other_vertex] == 1:
q.put(other_vertex)
seconds += 1
return seconds
Python 3โ
def solution(N, A, B, M):
degree = [0] * N
for i in range(M):
degree[A[i]] += 1
degree[B[i]] += 1
q = Queue()
for i in range(N):
if degree[i] <= 1:
q.put(i)
seconds = 0
while not q.empty():
q_size = q.qsize()
for i in range(q_size):
vertex = q.get()
for j in range(M):
if A[j] == vertex or B[j] == vertex:
other_vertex = B[j] if A[j] == vertex else A[j]
degree[other_vertex] -= 1
if degree[other_vertex] == 1:
q.put(other_vertex)
seconds += 1
return seconds
Python 3โ