agul's blog

By agul, history, 11 years ago, translation, In English

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?

  • Vote: I like it
  • +68
  • Vote: I do not like it

| Write comment?
»
11 years ago, hide # |
 
Vote: I like it +383 Vote: I do not like it
»
11 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

...and what do zeroes and ones mean? You cannot go over the ones?