Number of ways between two vertices

Revision en1, by agul, 2015-07-04 22:14:21

Hi!

Today I faced this problem: https://www.hackerearth.com/codex-6-0/algorithm/dummy-4-1/.

Problem statement in short: there are ones and zeroes in two-dimensional array N × N. How many ways do exist between top-left corner and bottom-right corner, if you can travel in horizontal or vertical directions only (not only down/right but in any direction) and you cannot visit any cell twice? N ≤ 100

All accepted solutions are simple bruteforce, that gets TL on array 100x100 with all zeroes in it.

What is the approach to solve this problem?

Tags number of ways

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English agul 2015-07-04 22:14:21 662 Initial revision for English translation
ru1 Russian agul 2015-07-04 22:09:36 704 Первая редакция (опубликовано)