We have solved the problem, and we have gone from brute force and ended with the most optimal solution. Also, we have covered the algorithm with intuition.
There is a lot to learn, keep in mind :-
" SIKHOGE NHI TO JEETOGE KAISE "
*****************************************************************
Visit Diploma Warriors website for CS/IT technical subjects and Programming languages: https://diplomawarriors.in/
********************************************************************
Do provide you feedback in the comments, we are going to make it best collectively.
"We work to make make impact on every students life".