2017-07-20から1日間の記事一覧

#15/20 DFS: Connected Cell in a Grid [Cracking the Coding Interview Challenges]

#15 DFS: Connected Cell in a Grid www.hackerrank.com 以下のような入力が与えられる。 4 4 1 1 0 0 0 1 1 0 0 0 1 0 1 0 0 0 1行目にn行、2行目にm列、それ以降はn行m列分のマトリックスがスペース区切りで与えられる。 マトリックス内で、1のセルが隣接…