Today's question was Tricky, I thought search from the left and search from the right if the index intersects then return True else False. BUT that didn't work. The best approach requires you to check the left indexes first then right indexes if we reach end or start return true.
GFG POTD Initially I was doing the weird thing storing all the sub arrays sum in a HashSet and then searching from left to right and Obviously I was wrong. But below is the correct approach to the question.
#LeetCode#POTD#dsa#problem wants you to divide the sorted array such that the sum of first and last should be equal to (first - 1)th + (last - 1)th... (first - n)th + (last - n)th term and find the sum of the product the opposite end elements. I hope it makes sense.๐คจ
(Day 24) GFG's POTD solution question wants you to find the elements whose frequency is greater than N/3.
The solution is very simple just add everything in a map and update the frequency accordingly.
Below is the solution in Java.
#POTDwithGFG#dsa#geeksforgeeks
Today's GFG POTD was a very simple question which involves the use of ArrayList. You need to know only two things how to add and how to delete in the ArrayList.
Below is the solution in java.
#POTDwithGFG#geekstreak2024#gfg
Day 21! ๐ I just completed the 21-day #geekstreak2024 powered by #DeutscheBank. This was my first coding challenge, and itโs been an exciting journey! From tough problems to easy wins, every day helped sharpen my skills. Now, Iโm ready for the next challenge! ๐
21/21 and I have finally completed the GFG's 21 days streak challenge. This is my #first time completing any programing #challenge ever. Now, I'm planning to continue the challenge and let's see where it takes me.
Cheers ๐ฅ๐ฅ๐ฅ #geekstreak2024#DeutscheBank
Day 16 of solving #geekstreak2024 powered by #DeutscheBank and todays question is similar to stock span problem with a different approach.
Below is the solution in java.