GfG Weekly Coding Contest - 190 Post Analysis | GeeksforGeeks Practice

preview_player
Показать описание
#GeeksforGeeks #GfGPractice #WeeklyCodingContest
Join us for a post-contest analysis with Ayush Tripathi where we will discuss the problems from the GFG Weekly Coding Contest - 189. In this session, Ayush will share his approach to solving problems and provide valuable insights on approaching similar problems in the future.

Whether you participated in the contest or not, this session is a great opportunity to learn new problem-solving techniques and deepen your understanding of data structures and algorithms. You'll have the chance to ask questions and interact with other participants, making this a fun and engaging learning experience.

-----------------------------------------------------------------------------------------


-----------------------------------------------------------------------------------------

Follow us and stay updated on everything happening in the world of geeks:


#GFGPractice #GeeksforGeeks #WeeklyCodingContest #CodingQuestions
#WeeklyCodingContest190 #ayushtripathi
Рекомендации по теме
Комментарии
Автор

Bro, please do provide timestamps for each question discussed.
It would be really helpful to navigate straight to the question which we wouldn't able to solve during the contest.

akashpandit
Автор

Don't understand the explanation of problem 3, I had created the memoization solution, but got no help for tabulation from here at all.

mrsad
Автор

The problem 3 explanation is not good .

ayaaniqbal
Автор

class Solution {//this code is passing TLE and easy to understand help me understand tabulation code
int solve( vector<int>&arr, int n, int t_or, int max_or, vector<vector<int>> &dp){
if(t_or==max_or)
return 0;
if(n<0){
return 1e8;

}
if(dp[n][t_or]!=1e8+7)
return dp[n][t_or];
int not_take=solve(arr, n-1, t_or, max_or, dp);
int take=solve(arr, n-1, t_or|arr[n], max_or, dp)+1;

return dp[n][t_or]= min(take, not_take);

}
public:
int minLength(vector<int>& arr) {
int n=arr.size();
int max_or=0;
for(auto it: arr){
max_or|=it;
}
vector<vector<int>> dp(n, vector<int>(max_or+1, 1e8+7));
int ans=solve(arr, n-1, 0, max_or, dp);
return ans;
}
};

mrsad