Performance Analysis
I believe I did pretty good for my first contest. I have recently started working on this platform and have set an ambition to reach Legendary Grandmaster.
Coming to the analysis part.
A. Convergence
The problem was based mostly on logical reasoning and figuring out the pattern. Firstly we had to sort the array then choose a target number (location) where all the friend would meet.
To figure out the location choose a number and figure out how many friends are on the left side of that number and how many are on the right side. Do this and figure out the number with optimal left and right side values. '
That's it..!
B. Cake Leveling
This was a problem based on figuring out the mathematical form and pattern recognition in some sense. we had to find the optimal height of frosting at each index.
To do that first store the current sum of the height of frosting, then figure out the average based on the index (we can think of it as layer of the cake Ex. 1st Layer...) and current sum of the frosting, to figure out the optimal height of frosting.
Next, the minimum of average calculated of current level and average of previous level, to manage the excess frosting problem.



