Question from Google coding round

Google · Question · Posted Jul 2021

<problem>328</problem> <h1> Prime Path </h1> <iframe src="https://drive.google.com/file/d/1kHFUiESQL7Nmlu0SP-O7FqSAmzPIup9q/preview" width="1200" height="480" allow="autoplay"></iframe>   Prime Path You are given an N x N grid G and each cell of the grid contains an integer. In one step you can travel from any cell Gi1j1 to Gi2j2, if abs(j1 - j2) + abs(i1 - i2) S p at a cost of floor (Gi1j1), where p is the number of unique prime factors of the integer at Gi1j1 Task Determine the minimum cost to travel from ...

The full answer & interview discussion are available to premium members.

Log in Create a free account