fa
Feedback
LeetCode Weekly Solutions

LeetCode Weekly Solutions

رفتن به کانال در Telegram

Latest Jobs and Internships are regularly uploaded here : https://t.me/placementlelo If you want any other exam answers for free : @exam_cheating_bot Collaborations: @growth_admin

نمایش بیشتر
7 053
مشترکین
اطلاعاتی وجود ندارد24 ساعت
-67 روز
-4430 روز
آرشیو پست ها
Send your questions in this group 👇🏻 https://telegram.me/flipkart_grid_exam_solutions

Security, Decentralization, and Scalability https://telegram.me/+_hn3cBQVbGliYTI9
Security, Decentralization, and Scalability https://telegram.me/+_hn3cBQVbGliYTI9

Send your questions in this group 👇🏻 https://telegram.me/flipkart_grid_exam_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 ✅

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.

Flipkart Grid Previous Year Questions and Answers 👇🏻 1. https://youtu.be/usCTPzm9TAY 2. https://youtu.be/DEfZ41m_leg 3. https://youtu.be/5rqQO2P8buE

Infosys SP 4th August 100% Correct Exam Answers uploaded 👇 https://youtu.be/Ivjh3FjEGnY https://youtu.be/Ivjh3FjEGnY Share this with your friends ✅

We will be uploading a video for today's Infosys exam 100% correct answers in next 10 minutes Only Subscribers can view the video ‼️ So SUBSCRIBE this YouTube Channel FAST 👇🏻 https://www.youtube.com/@placementlelo https://www.youtube.com/@placementlelo

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 ! ✅

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

Squares Beauty Code Infosys SP Exam C++ https://telegram.me/+_hn3cBQVbGliYTI9 void helper(const vector<vector<int>>& A, vector<vector<vector<int>>>& sum, int N) { for (int i = 0; i < N; ++i) { for (int j = 0; j < N; ++j) { for (int size = 1; size <= N - max(i, j); ++size) { sum[i][j][size] = 0; for (int x = 0; x < size; ++x) { for (int y = 0; y < size; ++y) { sum[i][j][size] += A[i + x][j + y]; } } } } } } https://telegram.me/PLACEMENTLELO int get_ans(int N, const vector<vector<int>>& A) { vector<vector<vector<int>>> sum(N, vector<vector<int>>(N, vector<int>(N + 1, 0))); helper(A, sum, N); int maxSum = INT_MIN; https://telegram.me/PLACEMENTLELO for (int size1 = 1; size1 <= N; ++size1) { for (int size2 = 1; size2 <= N; ++size2) { for (int i1 = 0; i1 + size1 <= N; ++i1) { for (int j1 = 0; j1 + size1 <= N; ++j1) { for (int i2 = 0; i2 + size2 <= N; ++i2) { for (int j2 = 0; j2 + size2 <= N; ++j2) { if (i1 + size1 <= i2 || i2 + size2 <= i1) { if (j1 + size1 <= j2 || j2 + size2 <= j1) { int sum1 = sum[i1][j1][size1]; int sum2 = sum[i2][j2][size2]; maxSum = max(maxSum, sum1 + sum2); } } } } } } } } https://telegram.me/PLACEMENTLELO return maxSum; } Squares Beauty Code Infosys SP Exam C++ https://telegram.me/+_hn3cBQVbGliYTI9

Flip the Bracket Code Infosys SP Exam C++ https://telegram.me/+_hn3cBQVbGliYTI9 #include <iostream> #include <vector> const int MOD = 1e9 + 7; https://telegram.me/PLACEMENTLELO int solve(const std::string& S, int K) { int N = S.size(); std::vector<std::vector<int>> dp(N + 1, std::vector<int>(K + 1, 0)); https://telegram.me/PLACEMENTLELO dp[0][0] = 1; for (int i = 1; i <= N; i++) { for (int j = 0; j <= K; j++) { if (S[i - 1] == '(') { dp[i][j] = (dp[i][j] + dp[i - 1][j]) % MOD; if (j > 0) { dp[i][j] = (dp[i][j] + dp[i - 1][j - 1]) % MOD; } } https://telegram.me/PLACEMENTLELO else { if (i > 1) { dp[i][j] = (dp[i][j] + dp[i - 2][j]) % MOD; } if (j > 0 && i > 1) { dp[i][j] = (dp[i][j] + dp[i - 2][j - 1]) % MOD; } } } } https://telegram.me/PLACEMENTLELO int result = 0; for (int j = 0; j <= K; j++) { result = (result + dp[N][j]) % MOD; } return result; } https://telegram.me/PLACEMENTLELO int main() { std::string S; int K; std::cin >> S >> K; int result = solve(S, K); std::cout << result << std::endl; return 0; } Flip the Bracket Code Infosys SP Exam C++ https://telegram.me/+_hn3cBQVbGliYTI9