![]() |
About the contest: LeetCode #Biweekly Contest 95This contest was organized by Leetcode on Jan 7th, it consisted of 4 questions and the time given to solve them was 1 hour 30 minutes i.e. 90 mins. Link of the contest: 95th Leetcode Biweekly Contest Overview of the questions:
LET’S DISCUSS: Problem 1: Categorize the Box According to the CriteriaMy Experience: As usual like all other contests, the first question was a cakewalk problem. One of the easiest problems even for beginners. Just simple question reading and implementation. Nothing complicated, You only have to do what is stated. Accepted Solution:
Problem 2: Find Consecutive Integers from a Data StreamMy Experience: This question was a design question. One was supposed to design a class that Returns true if the last ‘k’ integers are equal to value ‘x’. As soon as I read the statement “last k integers”, Stack data structure immediately striked into my mind. Accepted Solution:
Problem 3: Find Xor-Beauty of ArrayMy Experience: This according to me was potentially the easiest medium question on the platform. Even the code was smaller than the question. Yet it took me entire 12 minutes to identify the pattern in the test cases. They gave an entire 10 SIZED ARRAY in the test case, not even a 4-5 length one. I was surprised to see that the XOR of entire array came out to be expected answer. This hold true for both the test cases. Therefore I gave it a try and coded it within 1 min. Fortunately, it passed all test cases and my rank rose by 6000+ spots. Accepted Solution:
Problem 4: Maximize the Minimum Powered CityMy Experience: Being honest, after the third question got accepted, my adrenaline was at the peak aiming for an under 500 rank. But unlike usual contests, this D problem was a comparatively difficult one. Whenever I read the term Minimize the maximum value or Maximize the minimum value, I wonder how it could be solved using binary search. I tried binary search approach. My intuition was to check if it is possible to achieve a minimum power of min_power with the given number of power stations. If the power of the next city is already greater than or equal to the required minimum power, we don’t need to add any power stations. However my approach didn’t worked for some basic testcases and at last I ended up struggling entire 60 mins on the question. I submitted my solution twice, but both gave wrong answers upon submission. Accepted Solution:
Conclusion: Like other biweekly contests this contest was also rich into multiple DSA fundamental algorithms. Usually I manage to solve 3 and sometimes 4 as well, but in this contest I deeply struggled on the last question. The takeaway was to never underestimate any data structure and cover every algorithm with equal determination whilst not making any predictions that it would never be asked. |
Reffered: https://www.geeksforgeeks.org
Contest Experiences |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |