menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Google News

>

Day 23 of ...
source image

Medium

2M

read

353

img
dot

Image Credit: Medium

Day 23 of Cracking GOOOOGLE

  • The goal was to find the k closest points to the origin (0, 0) on an X-Y plane, using Euclidean distance.
  • The initial solution used a map> to store the distance along with the corresponding point.
  • After encountering a failing test case, it was realized that distance isn't always unique, so a map>> was used instead.
  • The updated solution worked perfectly and the problem was solved in 21 minutes.

Read Full Article

like

21 Likes

For uninterrupted reading, download the app