Forwarded from TCS CODEVITA SEASON 13 SOLUTIONS
Two Squares Code
Infosys SP Exam
C++
https://telegram.me/+_hn3cBQVbGliYTI9
#include <bits/stdc++.h>
using namespace std;
void precomputeMaxMin(vector<vector<int>> &grid, vector<vector<vector<int>>> &maxVal, vector<vector<vector<int>>> &minVal, int N) {
for (int size = 1; size <= N; size++) {
for (int i = 0; i <= N - size; i++) {
for (int j = 0; j <= N - size; j++) {
if (size == 1) {
maxVal[i][j][size] = grid[i][j];
minVal[i][j][size] = grid[i][j];
} else {
int prevMax = maxVal[i][j][size - 1];
int placementlelo = minVal[i][j][size - 1];
for (int k = 0; k < size; k++) {
prevMax = max({prevMax, grid[i + size - 1][j + k], grid[i + k][j + size - 1]});
placementlelo = min({placementlelo, grid[i + size - 1][j + k], grid[i + k][j + size - 1]});
}
maxVal[i][j][size] = prevMax;
minVal[i][j][size] = placementlelo;
https://telegram.me/PLACEMENTLELO
}
}
}
}
}
int getBeauty(vector<vector<vector<int>>> &maxVal, vector<vector<vector<int>>> &minVal, int x, int y, int size) {
return maxVal[x][y][size] - minVal[x][y][size];
}
https://telegram.me/PLACEMENTLELO
int get_ans(vector<vector<int>> &grid, int N) {
vector<vector<vector<int>>> maxVal(N, vector<vector<int>>(N, vector<int>(N + 1, 0)));
vector<vector<vector<int>>> minVal(N, vector<vector<int>>(N, vector<int>(N + 1, 0)));
precomputeMaxMin(grid, maxVal, minVal, N);
int maxBeautySum = 0;
https://telegram.me/PLACEMENTLELO
for (int size1 = 1; size1 <= N; size1++) {
for (int x1 = 0; x1 <= N - size1; x1++) {
for (int y1 = 0; y1 <= N - size1; y1++) {
int beauty1 = getBeauty(maxVal, minVal, x1, y1, size1);
https://telegram.me/PLACEMENTLELO
for (int size2 = 1; size2 <= N; size2++) {
for (int x2 = 0; x2 <= N - size2; x2++) {
for (int y2 = 0; y2 <= N - size2; y2++) {
if ((x1 + size1 <= x2 x2 + size2 <= x1) && (y1 + size1 <= y2 y2 + size2 <= y1)) {
int beauty2 = getBeauty(maxVal, minVal, x2, y2, size2);
maxBeautySum = max(maxBeautySum, beauty1 + beauty2);
}
}
}
}
}
}
}
https://telegram.me/PLACEMENTLELO
return maxBeautySum;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
https://telegram.me/PLACEMENTLELO
vector<vector<int>> grid(N, vector<int>(N));
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
cin >> grid[i][j];
}
}
https://telegram.me/PLACEMENTLELO
int result = get_ans(grid, N);
cout << result << endl;
return 0;
}
Two Squares Code
Infosys SP Exam
C++
https://telegram.me/+_hn3cBQVbGliYTI9
Infosys SP Exam
C++
https://telegram.me/+_hn3cBQVbGliYTI9
#include <bits/stdc++.h>
using namespace std;
void precomputeMaxMin(vector<vector<int>> &grid, vector<vector<vector<int>>> &maxVal, vector<vector<vector<int>>> &minVal, int N) {
for (int size = 1; size <= N; size++) {
for (int i = 0; i <= N - size; i++) {
for (int j = 0; j <= N - size; j++) {
if (size == 1) {
maxVal[i][j][size] = grid[i][j];
minVal[i][j][size] = grid[i][j];
} else {
int prevMax = maxVal[i][j][size - 1];
int placementlelo = minVal[i][j][size - 1];
for (int k = 0; k < size; k++) {
prevMax = max({prevMax, grid[i + size - 1][j + k], grid[i + k][j + size - 1]});
placementlelo = min({placementlelo, grid[i + size - 1][j + k], grid[i + k][j + size - 1]});
}
maxVal[i][j][size] = prevMax;
minVal[i][j][size] = placementlelo;
https://telegram.me/PLACEMENTLELO
}
}
}
}
}
int getBeauty(vector<vector<vector<int>>> &maxVal, vector<vector<vector<int>>> &minVal, int x, int y, int size) {
return maxVal[x][y][size] - minVal[x][y][size];
}
https://telegram.me/PLACEMENTLELO
int get_ans(vector<vector<int>> &grid, int N) {
vector<vector<vector<int>>> maxVal(N, vector<vector<int>>(N, vector<int>(N + 1, 0)));
vector<vector<vector<int>>> minVal(N, vector<vector<int>>(N, vector<int>(N + 1, 0)));
precomputeMaxMin(grid, maxVal, minVal, N);
int maxBeautySum = 0;
https://telegram.me/PLACEMENTLELO
for (int size1 = 1; size1 <= N; size1++) {
for (int x1 = 0; x1 <= N - size1; x1++) {
for (int y1 = 0; y1 <= N - size1; y1++) {
int beauty1 = getBeauty(maxVal, minVal, x1, y1, size1);
https://telegram.me/PLACEMENTLELO
for (int size2 = 1; size2 <= N; size2++) {
for (int x2 = 0; x2 <= N - size2; x2++) {
for (int y2 = 0; y2 <= N - size2; y2++) {
if ((x1 + size1 <= x2 x2 + size2 <= x1) && (y1 + size1 <= y2 y2 + size2 <= y1)) {
int beauty2 = getBeauty(maxVal, minVal, x2, y2, size2);
maxBeautySum = max(maxBeautySum, beauty1 + beauty2);
}
}
}
}
}
}
}
https://telegram.me/PLACEMENTLELO
return maxBeautySum;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin >> N;
https://telegram.me/PLACEMENTLELO
vector<vector<int>> grid(N, vector<int>(N));
for (int i = 0; i < N; i++) {
for (int j = 0; j < N; j++) {
cin >> grid[i][j];
}
}
https://telegram.me/PLACEMENTLELO
int result = get_ans(grid, N);
cout << result << endl;
return 0;
}
Two Squares Code
Infosys SP Exam
C++
https://telegram.me/+_hn3cBQVbGliYTI9
👍7❤3
Forwarded from TCS CODEVITA SEASON 13 SOLUTIONS
Now all other 100% Correct Infosys Codes will be uploaded on these two channels 👇🏻
1. https://telegram.me/PLACEMENTLELO
2. https://telegram.me/OFF_CAMPUS_JOBS_AND_INTERNSHIPS
Join both channels Fast ! ✅
1. https://telegram.me/PLACEMENTLELO
2. https://telegram.me/OFF_CAMPUS_JOBS_AND_INTERNSHIPS
Join both channels Fast ! ✅
👍5❤2
Infosys SP 4th August 100% Correct Exam Answers uploaded 👇
https://youtu.be/Ivjh3FjEGnY
https://youtu.be/Ivjh3FjEGnY
Share this with your friends ✅
https://youtu.be/Ivjh3FjEGnY
https://youtu.be/Ivjh3FjEGnY
Share this with your friends ✅
👍7
Flipkart Grid Previous Year Questions and Answers 👇🏻
1. https://youtu.be/usCTPzm9TAY
2. https://youtu.be/DEfZ41m_leg
3. https://youtu.be/5rqQO2P8buE
1. https://youtu.be/usCTPzm9TAY
2. https://youtu.be/DEfZ41m_leg
3. https://youtu.be/5rqQO2P8buE
👍2❤1🥰1👨💻1
Forwarded from TCS CODEVITA SEASON 13 SOLUTIONS
Flipkart Grid Exam Details:
Exam Window - 8 Hours (from 12 PM to 8 PM in each slot)
https://telegram.me/PLACEMENTLELO
Online Exam Duration - 30 Minutes
Total Questions - 24 Multiple Choice Questions
Time per question - 75 seconds
https://telegram.me/PLACEMENTLELO
Participants will be ranked on accuracy (score) and speed (time taken to answer the questions).
https://telegram.me/PLACEMENTLELO
There is no negative marking for this assessment.
Note: All team members must take the exam and the average scores of all the members will be considered for shortlisting.
Exam Window - 8 Hours (from 12 PM to 8 PM in each slot)
https://telegram.me/PLACEMENTLELO
Online Exam Duration - 30 Minutes
Total Questions - 24 Multiple Choice Questions
Time per question - 75 seconds
https://telegram.me/PLACEMENTLELO
Participants will be ranked on accuracy (score) and speed (time taken to answer the questions).
https://telegram.me/PLACEMENTLELO
There is no negative marking for this assessment.
Note: All team members must take the exam and the average scores of all the members will be considered for shortlisting.
👍4
Forwarded from TCS CODEVITA SEASON 13 SOLUTIONS
Flipkart Grid 6.0 Exam Answers will be uploaded here 👇
https://telegram.me/+_hn3cBQVbGliYTI9
Flipkart Grid 6.0 Discussion Group 👇
https://telegram.me/+njYA5MfMVcs5OTRl
Share this with your friends ✅
https://telegram.me/+_hn3cBQVbGliYTI9
Flipkart Grid 6.0 Discussion Group 👇
https://telegram.me/+njYA5MfMVcs5OTRl
Share this with your friends ✅
👍1
Forwarded from TCS CODEVITA SEASON 13 SOLUTIONS
Send your questions in this group 👇🏻
https://telegram.me/flipkart_grid_exam_solutions
https://telegram.me/flipkart_grid_exam_solutions
👍1
Forwarded from TCS CODEVITA SEASON 13 SOLUTIONS
Send your questions in this group 👇🏻
https://telegram.me/flipkart_grid_exam_solutions
https://telegram.me/flipkart_grid_exam_solutions
Forwarded from TCS CODEVITA SEASON 13 SOLUTIONS
Forwarded from TCS CODEVITA SEASON 13 SOLUTIONS
Forwarded from TCS CODEVITA SEASON 13 SOLUTIONS
Forwarded from TCS CODEVITA SEASON 13 SOLUTIONS