string solve(string s) {
string pre, post;
deque<char> sDeque(s.begin(), s.end());
char minChar = *min_element(sDeque.begin(), sDeque.end());
while (!sDeque.empty()) {
pre.push_back(sDeque.front());
sDeque.pop_front();
if (!sDeque.empty() && pre.back() == minChar) {
minChar = *min_element(sDeque.begin(), sDeque.end());
}
while (!pre.empty() && (sDeque.empty() || pre.back() <= minChar)) {
post.push_back(pre.back());
pre.pop_back();
}
}
while (!pre.empty()) {
post.push_back(pre.back());
pre.pop_back();
}
return post;
}
DE Shaw โ
string pre, post;
deque<char> sDeque(s.begin(), s.end());
char minChar = *min_element(sDeque.begin(), sDeque.end());
while (!sDeque.empty()) {
pre.push_back(sDeque.front());
sDeque.pop_front();
if (!sDeque.empty() && pre.back() == minChar) {
minChar = *min_element(sDeque.begin(), sDeque.end());
}
while (!pre.empty() && (sDeque.empty() || pre.back() <= minChar)) {
post.push_back(pre.back());
pre.pop_back();
}
}
while (!pre.empty()) {
post.push_back(pre.back());
pre.pop_back();
}
return post;
}
DE Shaw โ
๐3
take low = 1
DE Shaw โ
DE Shaw โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
class Dice {
public:
int t, b, l, r, f, k;
Dice() {
t = 1; b = 6; l = 4; r = 3; f = 2; k = 5;
}
void rollRight() {
int temp = t;
t = l;
l = b;
b = r;
r = temp;
}
void rollLeft() {
int temp = t;
t = r;
r = b;
b = l;
l = temp;
}
void rollDown() {
int temp = t;
t = k;
k = b;
b = f;
f = temp;
}
};
int calculateCubeSum(int R, int C) {
Dice dice;
int s = 0;
for (int i = 0; i < R; ++i) {
if (i % 2 == 0) {
for (int j = 0; j < C; ++j) {
s += dice.t;
if (j < C - 1) dice.rollRight();
}
} else {
for (int j = C - 1; j >= 0; --j) {
s += dice.t;
if (j > 0) dice.rollLeft();
}
}
if (i < R - 1) dice.rollDown();
}
return s;
}
Rolling a Dice โ
Goldman Sachs
public:
int t, b, l, r, f, k;
Dice() {
t = 1; b = 6; l = 4; r = 3; f = 2; k = 5;
}
void rollRight() {
int temp = t;
t = l;
l = b;
b = r;
r = temp;
}
void rollLeft() {
int temp = t;
t = r;
r = b;
b = l;
l = temp;
}
void rollDown() {
int temp = t;
t = k;
k = b;
b = f;
f = temp;
}
};
int calculateCubeSum(int R, int C) {
Dice dice;
int s = 0;
for (int i = 0; i < R; ++i) {
if (i % 2 == 0) {
for (int j = 0; j < C; ++j) {
s += dice.t;
if (j < C - 1) dice.rollRight();
}
} else {
for (int j = C - 1; j >= 0; --j) {
s += dice.t;
if (j > 0) dice.rollLeft();
}
}
if (i < R - 1) dice.rollDown();
}
return s;
}
Rolling a Dice โ
Goldman Sachs
โค1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
void displayTheChannel(int N, vector<string>& channels, vector<int>& operations) {
int i = 0;
for (auto op : operations) {
if (op == 1) {
if (i < N - 1) {
swap(channels[i], channels[i + 1]);
i++;
}
} else if (op == 2) {
if (i > 0) {
swap(channels[i], channels[i - 1]);
i--;
}
} else if (op == 3) {
if (i < N - 1) {
swap(channels[i], channels[i + 1]);
i++;
}
}
}
for (const auto& channel : channels) {
cout << channel << endl;
}
}
int main() {
int N;
cin >> N; // Number of channels
vector<string> channels(N);
for (int i = 0; i < N; ++i) {
cin >> channels[i];
}
int M;
cin >> M;
vector<int> operations(M);
for (int i = 0; i < M; ++i) {
cin >> operations[i];
}
displayTheChannel(N, channels, operations);
return 0;
}
// CHANNEL SEQUENCE โ
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
void displayTheChannel(int N, vector<string>& channels, vector<int>& operations) {
int i = 0;
for (auto op : operations) {
if (op == 1) {
if (i < N - 1) {
swap(channels[i], channels[i + 1]);
i++;
}
} else if (op == 2) {
if (i > 0) {
swap(channels[i], channels[i - 1]);
i--;
}
} else if (op == 3) {
if (i < N - 1) {
swap(channels[i], channels[i + 1]);
i++;
}
}
}
for (const auto& channel : channels) {
cout << channel << endl;
}
}
int main() {
int N;
cin >> N; // Number of channels
vector<string> channels(N);
for (int i = 0; i < N; ++i) {
cin >> channels[i];
}
int M;
cin >> M;
vector<int> operations(M);
for (int i = 0; i < M; ++i) {
cin >> operations[i];
}
displayTheChannel(N, channels, operations);
return 0;
}
// CHANNEL SEQUENCE โ
๐1
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
#include <iostream>
#include <vector>
#include <sstream>
#include <unordered_map>
using namespace std;
void generateResult(int N, int M, vector<string>& employeeSalaryAndSuperior, vector<string>& operations) {
vector<int> salaries(N, 0);
unordered_map<int, vector<int>> supervisors;
for (int i = 0; i < N; ++i) {
stringstream ss(employeeSalaryAndSuperior[i]);
int salary, supervisor;
ss >> salary >> supervisor;
salaries[i] = salary;
if (supervisor != -1) {
supervisors[supervisor - 1].push_back(i);
}
}
for (int i = 0; i < M; ++i) {
stringstream ss(operations[i]);
char type;
ss >> type;
if (type == 'p') {
int A, X;
ss >> A >> X;
A -= 1;
for (int subordinate : supervisors[A]) {
salaries[subordinate] += X;
}
} else if (type == 'u') {
int B;
ss >> B;
B -= 1;
cout << salaries[B] << endl;
}
}
}
int main() {
int N, M;
cin >> N >> M;
cin.ignore();
vector<string> employeeSalaryAndSuperior(N);
for (int i = 0; i < N; ++i) {
getline(cin, employeeSalaryAndSuperior[i]);
}
vector<string> operations(M);
for (int i = 0; i < M; ++i) {
getline(cin, operations[i]);
}
generateResult(N, M, employeeSalaryAndSuperior, operations);
return 0;
}
Salary fluctuations โ
#include <vector>
#include <sstream>
#include <unordered_map>
using namespace std;
void generateResult(int N, int M, vector<string>& employeeSalaryAndSuperior, vector<string>& operations) {
vector<int> salaries(N, 0);
unordered_map<int, vector<int>> supervisors;
for (int i = 0; i < N; ++i) {
stringstream ss(employeeSalaryAndSuperior[i]);
int salary, supervisor;
ss >> salary >> supervisor;
salaries[i] = salary;
if (supervisor != -1) {
supervisors[supervisor - 1].push_back(i);
}
}
for (int i = 0; i < M; ++i) {
stringstream ss(operations[i]);
char type;
ss >> type;
if (type == 'p') {
int A, X;
ss >> A >> X;
A -= 1;
for (int subordinate : supervisors[A]) {
salaries[subordinate] += X;
}
} else if (type == 'u') {
int B;
ss >> B;
B -= 1;
cout << salaries[B] << endl;
}
}
}
int main() {
int N, M;
cin >> N >> M;
cin.ignore();
vector<string> employeeSalaryAndSuperior(N);
for (int i = 0; i < N; ++i) {
getline(cin, employeeSalaryAndSuperior[i]);
}
vector<string> operations(M);
for (int i = 0; i < M; ++i) {
getline(cin, operations[i]);
}
generateResult(N, M, employeeSalaryAndSuperior, operations);
return 0;
}
Salary fluctuations โ
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Salesforce is hiring Software Engineer Intern
50 - 65 k per month
2025 batch eligible
https://salesforce.wd12.myworkdayjobs.com/en-US/External_Career_Site/job/Intern_JR250704?s=08
Salesforce is hiring for Interns
2026 Passout
To get Referral follow these steps
In "How Did You Hear About Us" question
Select Referral and enter my Email s.sarkar@salesforce.com
50 - 65 k per month
2025 batch eligible
https://salesforce.wd12.myworkdayjobs.com/en-US/External_Career_Site/job/Intern_JR250704?s=08
Salesforce is hiring for Interns
2026 Passout
To get Referral follow these steps
In "How Did You Hear About Us" question
Select Referral and enter my Email s.sarkar@salesforce.com
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: Qualcomm
Location: Hyderabad
Role: SDE (Embedded Software)
For Graduates: 2022, 2023, 2024
https://www.linkedin.com/posts/soumen-ghosh-a1a958128_new-job-opening-at-qualcomm-below-activity-7218299548882849793-nzlO
Location: Hyderabad
Role: SDE (Embedded Software)
For Graduates: 2022, 2023, 2024
https://www.linkedin.com/posts/soumen-ghosh-a1a958128_new-job-opening-at-qualcomm-below-activity-7218299548882849793-nzlO
Linkedin
New Job Opening at Qualcomm!!๐จโ๐ป
Below are the basic details about theโฆ | Soumen Ghosh | 66 comments
Below are the basic details about theโฆ | Soumen Ghosh | 66 comments
New Job Opening at Qualcomm!!๐จโ๐ป
Below are the basic details about the current opening in my team.
Job location: Hyderabad
Requirements:
โ 0-4 years of work experience
โ Proficiency in C/C++
If you are interested to work in Embedded Software domain thenโฆ
Below are the basic details about the current opening in my team.
Job location: Hyderabad
Requirements:
โ 0-4 years of work experience
โ Proficiency in C/C++
If you are interested to work in Embedded Software domain thenโฆ
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Company: WeCP
Location: N/A
Role: SDE
For Graduates: 2024, 2023, 2022, 2021
https://assess.wecreateproblems.com/tests/147ea977-7bd5-48a3-96d3-fd9c609278fa/instructions
Location: N/A
Role: SDE
For Graduates: 2024, 2023, 2022, 2021
https://assess.wecreateproblems.com/tests/147ea977-7bd5-48a3-96d3-fd9c609278fa/instructions
Wecreateproblems
Spot talent worth betting on: WeCP
WeCP Assessment Software. Discover and Develop Tech Talents at Scale. Experience your tech assessment and training with phenomenal business growth.
๐1
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Interactive Brokers is hiring for Junior Software Engineer- Freshers (2024)
Experience: 0 - 1 year's
Expected Salary: 9 - 15 LPA
Apply here:
https://boards.greenhouse.io/ibkr/jobs/7524334002?gh_src=19375022
Experience: 0 - 1 year's
Expected Salary: 9 - 15 LPA
Apply here:
https://boards.greenhouse.io/ibkr/jobs/7524334002?gh_src=19375022
job-boards.greenhouse.io
Interactive Brokers
<p><span data-preserver-spaces="true">Interactive Brokers Group, Inc. (NASDAQ: "IBKR"); is a direct access electronic broker catering to the needs of professional and frequent traders, institutional investors, financial advisers, and introducing brokers.โฆ
๐2
Forwarded from OffCampus Jobs | OnCampus Jobs | Daily Jobs Updates | Lastest Jobs | All Jobs | CSE Jobs | Fresher Jobs โฅ (Dushyant)
Infoane is hiring for Software Engineer
Walkin Drive on 20 July 2024
Batch : 2024/2023 passouts eligible
Apply Here :
https://docs.google.com/forms/d/e/1FAIpQLSf7pqYTBC-SnKR5wvJysHYyLlfEXX35KuE9wcn35k554_JEgQ/viewform?pli=1
Walkin Drive on 20 July 2024
Batch : 2024/2023 passouts eligible
Apply Here :
https://docs.google.com/forms/d/e/1FAIpQLSf7pqYTBC-SnKR5wvJysHYyLlfEXX35KuE9wcn35k554_JEgQ/viewform?pli=1
Google Docs
Infoane Technologies - Trainee Software Engineer - July 20, 2024
Position: Trainee Software Engineer (Freshers)
Work location: Kovilpatti, Tamil Nadu
Education:
B.E/Btech/Mtech/MCA - CSE/IT/ECE/EEE
Above 60%+ in all academics
Mandatory:
Must carry all original certificates to the interview and a copy of profileโฆ
Work location: Kovilpatti, Tamil Nadu
Education:
B.E/Btech/Mtech/MCA - CSE/IT/ECE/EEE
Above 60%+ in all academics
Mandatory:
Must carry all original certificates to the interview and a copy of profileโฆ
def bird_nest(forest, bird):
nest = []
total_length = 0
direction = 1
current_position = bird
visited = set()
while total_length < 100:
while forest[current_position] == 0 or current_position in visited:
current_position += direction
nest.append(current_position)
total_length += forest[current_position]
visited.add(current_position)
current_position = bird
direction *= -1
return nest
Databrick โ
nest = []
total_length = 0
direction = 1
current_position = bird
visited = set()
while total_length < 100:
while forest[current_position] == 0 or current_position in visited:
current_position += direction
nest.append(current_position)
total_length += forest[current_position]
visited.add(current_position)
current_position = bird
direction *= -1
return nest
Databrick โ
๐๐ฆ ๐๐น๐ด๐ผ ๐ป ๐ ใ๐๐ผ๐บ๐ฝ๐ฒ๐๐ถ๐๐ถ๐๐ฒ ๐ฃ๐ฟ๐ผ๐ด๐ฟ๐ฎ๐บ๐บ๐ถ๐ป๐ดใ
Photo
List<Integer> results = new ArrayList<>();
int counter = 1;
Map<Integer, Integer> allocationMap = new HashMap<>();
for (int[] query : queries) {
if (query[0] == 0) {
int length = query[1];
int result = -1;
for (int i = 0; i <= memory.length - length; i++) {
boolean canAllocate = true;
for (int j = 0; j < length; j++) {
if (memory[i + j] != 0) {
canAllocate = false;
break;
}
}
if (canAllocate) {
for (int j = 0; j < length; j++) {
memory[i + j] = counter;
}
allocationMap.put(counter, length);
result = counter++;
break;
}
}
results.add(result);
} else if (query[0] == 1) {
int id = query[1];
if (!allocationMap.containsKey(id)) {
results.add(-1);
continue;
}
int length = allocationMap.get(id);
boolean erased = false;
for (int i = 0; i < memory.length; i++) {
if (memory[i] == id) {
for (int j = 0; j < length; j++) {
memory[i + j] = 0;
}
allocationMap.remove(id);
results.add(length);
erased = true;
break;
}
}
if (!erased) {
results.add(-1);
}
}
}
int[] resultArray = new int[results.size()];
for (int i = 0; i < results.size(); i++) {
resultArray[i] = results.get(i);
}
return resultArray;
}
int counter = 1;
Map<Integer, Integer> allocationMap = new HashMap<>();
for (int[] query : queries) {
if (query[0] == 0) {
int length = query[1];
int result = -1;
for (int i = 0; i <= memory.length - length; i++) {
boolean canAllocate = true;
for (int j = 0; j < length; j++) {
if (memory[i + j] != 0) {
canAllocate = false;
break;
}
}
if (canAllocate) {
for (int j = 0; j < length; j++) {
memory[i + j] = counter;
}
allocationMap.put(counter, length);
result = counter++;
break;
}
}
results.add(result);
} else if (query[0] == 1) {
int id = query[1];
if (!allocationMap.containsKey(id)) {
results.add(-1);
continue;
}
int length = allocationMap.get(id);
boolean erased = false;
for (int i = 0; i < memory.length; i++) {
if (memory[i] == id) {
for (int j = 0; j < length; j++) {
memory[i + j] = 0;
}
allocationMap.remove(id);
results.add(length);
erased = true;
break;
}
}
if (!erased) {
results.add(-1);
}
}
}
int[] resultArray = new int[results.size()];
for (int i = 0; i < results.size(); i++) {
resultArray[i] = results.get(i);
}
return resultArray;
}