# Blogs Hub

### by AskGif | Oct 15, 2020 | Category :coding

#### Flower Planting With No Adjacent - Graph - Easy - LeetCode

You have n gardens, labeled from 1 to n, and an array paths where paths[i] = [xi, yi] describes the existence of a bidirectional path from garden xi to garden yi. In each garden, you want to plant one of 4 types of flowers. There is no garden that has more than three paths coming into or l

### by AskGif | Oct 14, 2020 | Category :coding

#### Find the Town Judge - Tree - Easy - LeetCode

In a town, there are N people labelled from 1 to N. &nbsp;There is a rumor that one of these people is secretly the town judge. If the town judge exists, then: The town judge trusts nobody.<br />Everybody (except for the town judge) trusts the town judge.<br />There is exactly one p

### by AskGif | Oct 05, 2020 | Category :coding

#### Matrix Cells in Distance Order - Sort - Easy - LeetCode

We are given a matrix with R rows and C columns has cells with integer coordinates (r, c), where 0 &lt;= r &lt; R and 0 &lt;= c &lt; C. Additionally, we are given a cell in that matrix with coordinates (r0, c0). Return the coordinates of all cells in the matrix, sorted by their dist