Forwarded from Goldman Sachs Exam Solutions
Forwarded from Goldman Sachs Exam Solutions
Forwarded from Goldman Sachs Exam Solutions
Forwarded from Goldman Sachs Exam Solutions
Forwarded from Goldman Sachs Exam Solutions
Forwarded from Goldman Sachs Exam Solutions
Forwarded from Goldman Sachs Exam Solutions
Forwarded from Goldman Sachs Exam Solutions
✅ Goldman Sachs Exam 100% Correct Answers are uploaded here 👇🏻
https://youtu.be/BYwtNx7zaMg
https://youtu.be/BYwtNx7zaMg
Share with your friends 😇
https://youtu.be/BYwtNx7zaMg
https://youtu.be/BYwtNx7zaMg
Share with your friends 😇
Cognizant Exam Answers will be uploaded here 👇🏻
https://telegram.me/+Q_kf6B6EFexiNmU9
Cognizant Exam Discussion Group 👇🏻
https://telegram.me/+8B154b769wk4ZjY9
Share this with your friends 😇
https://telegram.me/+Q_kf6B6EFexiNmU9
Cognizant Exam Discussion Group 👇🏻
https://telegram.me/+8B154b769wk4ZjY9
Share this with your friends 😇
Cognizant
Database Query Question
https://telegram.me/+Q_kf6B6EFexiNmU9
SELECT instructor.first_name AS "First Name", instructor.last_name AS "Last Name"
FROM instructor
WHERE instructor.type = 'full-time'
AND instructor.last_name LIKE 'C%';
Cognizant
Database Query Question
https://telegram.me/PLACEMENTLELO
Database Query Question
https://telegram.me/+Q_kf6B6EFexiNmU9
SELECT instructor.first_name AS "First Name", instructor.last_name AS "Last Name"
FROM instructor
WHERE instructor.type = 'full-time'
AND instructor.last_name LIKE 'C%';
Cognizant
Database Query Question
https://telegram.me/PLACEMENTLELO
Forwarded from Placement Lelo 2.0
Google Hiring Software Engineer:
Graduation Year: 2024 / 2023
Salary: 35 to 40 LPA
Location: Bengaluru / Gurgaon / Hyderabad / Mumbai / Pune
Apply Link: https://tinyurl.com/55ehdkdj
Telegram: https://telegram.me/OFF_CAMPUS_JOBS_AND_INTERNSHIPS
Graduation Year: 2024 / 2023
Salary: 35 to 40 LPA
Location: Bengaluru / Gurgaon / Hyderabad / Mumbai / Pune
Apply Link: https://tinyurl.com/55ehdkdj
Telegram: https://telegram.me/OFF_CAMPUS_JOBS_AND_INTERNSHIPS
Bulk hiring is open for these 4 companies:
1. Capgemini
2. Accenture
3. Reliance
4. TCS
Last Date to Apply: 6 October
We have uploaded all the details in the LinkedIn post.
Post Link: https://bit.ly/mass_hiring
✅ Make sure to apply to all 4 opportunities.
Share this with your friends 😇
1. Capgemini
2. Accenture
3. Reliance
4. TCS
Last Date to Apply: 6 October
We have uploaded all the details in the LinkedIn post.
Post Link: https://bit.ly/mass_hiring
✅ Make sure to apply to all 4 opportunities.
Share this with your friends 😇
Leetcode Weekly 419
A
C++
https://telegram.me/+_hn3cBQVbGliYTI9
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<int> findXSum(vector<int>& nums, int k, int x) {
int n = nums.size();
vector<int> answer;
for (int i = 0; i <= n - k; ++i) {
unordered_map<int, int> frequency;
for (int j = i; j < i + k; ++j) {
frequency[nums[j]]++;
}
vector<pair<int, int>> freqList;
for (const auto& entry : frequency) {
freqList.push_back({entry.second, entry.first});
}
sort(freqList.begin(), freqList.end(), [](const pair<int, int>& a, const pair<int, int>& b) {
if (a.first != b.first) return a.first > b.first;
return a.second > b.second;
});
int sum = 0;
int count = 0;
for (const auto& entry : freqList) {
int frequency = entry.first;
int value = entry.second;
if (count >= x) break;
sum += frequency * value;
count++;
}
answer.push_back(sum);
}
return answer;
}
};
Leetcode Weekly 419
A
C++
https://telegram.me/+_hn3cBQVbGliYTI9
A
C++
https://telegram.me/+_hn3cBQVbGliYTI9
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<int> findXSum(vector<int>& nums, int k, int x) {
int n = nums.size();
vector<int> answer;
for (int i = 0; i <= n - k; ++i) {
unordered_map<int, int> frequency;
for (int j = i; j < i + k; ++j) {
frequency[nums[j]]++;
}
vector<pair<int, int>> freqList;
for (const auto& entry : frequency) {
freqList.push_back({entry.second, entry.first});
}
sort(freqList.begin(), freqList.end(), [](const pair<int, int>& a, const pair<int, int>& b) {
if (a.first != b.first) return a.first > b.first;
return a.second > b.second;
});
int sum = 0;
int count = 0;
for (const auto& entry : freqList) {
int frequency = entry.first;
int value = entry.second;
if (count >= x) break;
sum += frequency * value;
count++;
}
answer.push_back(sum);
}
return answer;
}
};
Leetcode Weekly 419
A
C++
https://telegram.me/+_hn3cBQVbGliYTI9
Leetcode Weekly 419
B
C++
https://telegram.me/+_hn3cBQVbGliYTI9
class Solution {
public:
pair<bool, int> checkPerfect(TreeNode* node) {
if (!node) return {true, 0};
auto leftResult = checkPerfect(node->left);
auto rightResult = checkPerfect(node->right);
if (leftResult.first && rightResult.first && leftResult.second == rightResult.second) {
return {true, leftResult.second + rightResult.second + 1};
}
return {false, 0};
}
void gatherPerfectSizes(TreeNode* node, vector<int>& subtreeSizes) {
if (!node) return;
auto result = checkPerfect(node);
if (result.first) {
subtreeSizes.push_back(result.second);
}
gatherPerfectSizes(node->left, subtreeSizes);
gatherPerfectSizes(node->right, subtreeSizes);
}
int kthLargestPerfectSubtree(TreeNode* root, int k) {
vector<int> subtreeSizes;
gatherPerfectSizes(root, subtreeSizes);
if (subtreeSizes.empty()) return -1;
sort(subtreeSizes.rbegin(), subtreeSizes.rend());
return (k <= subtreeSizes.size()) ? subtreeSizes[k - 1] : -1;
}
};
Leetcode Weekly 419
B
C++
https://telegram.me/+_hn3cBQVbGliYTI9
B
C++
https://telegram.me/+_hn3cBQVbGliYTI9
class Solution {
public:
pair<bool, int> checkPerfect(TreeNode* node) {
if (!node) return {true, 0};
auto leftResult = checkPerfect(node->left);
auto rightResult = checkPerfect(node->right);
if (leftResult.first && rightResult.first && leftResult.second == rightResult.second) {
return {true, leftResult.second + rightResult.second + 1};
}
return {false, 0};
}
void gatherPerfectSizes(TreeNode* node, vector<int>& subtreeSizes) {
if (!node) return;
auto result = checkPerfect(node);
if (result.first) {
subtreeSizes.push_back(result.second);
}
gatherPerfectSizes(node->left, subtreeSizes);
gatherPerfectSizes(node->right, subtreeSizes);
}
int kthLargestPerfectSubtree(TreeNode* root, int k) {
vector<int> subtreeSizes;
gatherPerfectSizes(root, subtreeSizes);
if (subtreeSizes.empty()) return -1;
sort(subtreeSizes.rbegin(), subtreeSizes.rend());
return (k <= subtreeSizes.size()) ? subtreeSizes[k - 1] : -1;
}
};
Leetcode Weekly 419
B
C++
https://telegram.me/+_hn3cBQVbGliYTI9
Leetcode Weekly 419
C
Python
https://telegram.me/+Q_kf6B6EFexiNmU9
MOD = 10**9 + 7
class Solution:
def countWinningSequences(self, s: str) -> int:
n = len(s)
win_against = {'F': 'W', 'W': 'E', 'E': 'F'}
memo = {}
def dp(i, last_bob_move, score_diff):
if i == n:
return 1 if score_diff > 0 else 0
if (i, last_bob_move, score_diff) in memo:
return memo[(i, last_bob_move, score_diff)]
total_ways = 0
alice_move = s[i]
for bob_move in 'FWE':
if bob_move == last_bob_move:
continue
new_score_diff = score_diff
if bob_move == win_against[alice_move]:
new_score_diff += 1
elif win_against[bob_move] == alice_move:
new_score_diff -= 1
total_ways = (total_ways + dp(i + 1, bob_move, new_score_diff)) % MOD
memo[(i, last_bob_move, score_diff)] = total_ways
return total_ways
return dp(0, None, 0)
Leetcode Weekly 419
C
Python
https://telegram.me/+Q_kf6B6EFexiNmU9
C
Python
https://telegram.me/+Q_kf6B6EFexiNmU9
MOD = 10**9 + 7
class Solution:
def countWinningSequences(self, s: str) -> int:
n = len(s)
win_against = {'F': 'W', 'W': 'E', 'E': 'F'}
memo = {}
def dp(i, last_bob_move, score_diff):
if i == n:
return 1 if score_diff > 0 else 0
if (i, last_bob_move, score_diff) in memo:
return memo[(i, last_bob_move, score_diff)]
total_ways = 0
alice_move = s[i]
for bob_move in 'FWE':
if bob_move == last_bob_move:
continue
new_score_diff = score_diff
if bob_move == win_against[alice_move]:
new_score_diff += 1
elif win_against[bob_move] == alice_move:
new_score_diff -= 1
total_ways = (total_ways + dp(i + 1, bob_move, new_score_diff)) % MOD
memo[(i, last_bob_move, score_diff)] = total_ways
return total_ways
return dp(0, None, 0)
Leetcode Weekly 419
C
Python
https://telegram.me/+Q_kf6B6EFexiNmU9
TCS CodeVita Exam Answers Group👇🏻
https://www.linkedin.com/posts/placementlelo_tcs-tcscodevita-career-activity-7262117016117886976-be3X
Share this with your friends 😇
https://www.linkedin.com/posts/placementlelo_tcs-tcscodevita-career-activity-7262117016117886976-be3X
Share this with your friends 😇
TCS CodeVita Exam Answers will be uploaded here 👇🏻
https://telegram.me/+_hn3cBQVbGliYTI9
TCS CodeVita Discussion Group 👇🏻
https://telegram.me/+oZ4x3k1RtXdkNWU1
✅ Must join both the groups !
Share these groups with your friends and help them get a job 😇
https://telegram.me/+_hn3cBQVbGliYTI9
TCS CodeVita Discussion Group 👇🏻
https://telegram.me/+oZ4x3k1RtXdkNWU1
✅ Must join both the groups !
Share these groups with your friends and help them get a job 😇
✅ TCS CodeVita All 100% Correct Answers uploaded 👇🏻
https://youtu.be/a9wgj8hm20g
https://youtu.be/a9wgj8hm20g
Share this with your friends 😇
https://youtu.be/a9wgj8hm20g
https://youtu.be/a9wgj8hm20g
Share this with your friends 😇