GFG Weekly Coding Contest - 171 Post Analysis | GeeksforGeeks Practice

preview_player
Показать описание
Join us for a post-contest analysis with Ayush Tripathi where we will discuss the problems from the GFG Weekly Coding Contest - 171. In this session, Nitin 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
#WeeklyCodingContest171 #nitinkaplas
Рекомендации по теме
Комментарии
Автор

for question 2nd simple approach would be to sort arr1 in ascending order and arr2 in descending order and then apply simple 2 pointers.
code will be like this:
long long fndMax(int n, int m, vector<int>& arr1, vector<int>& arr2) {
sort(arr1.begin(), arr1.end());
sort(arr2.begin(), arr2.end(), greater<int>());
int i=0, j=n-1;
int k=0, l=m-1;
long long ans=0;
while(i<=j&&k<=l){

ans+=abs(arr1[i]-arr2[k]);
i++;
k++;
}
else{
ans+=abs(arr1[j]-arr2[l]);
j--;
l--;
}
}
return ans;
}

anuragpatel
Автор

Please Bring back Yash Dwivedi sir or Sid Sir :)

AdityaYadavansi-kj
Автор

didn't understand a thing you were saying. please give clear explanations

prathameshpatil
Автор

The explanation is not that good.If necessary make the video long but don't compromise on explanation.

ayaaniqbal
Автор

bro you can speak in hindi if you want

chikuu