Hello!
I am new one here. Firstly I would like to say that I'm really poor in english, so be patient with me..
In the school we had a new task. So let me explain: we have a 2d array with numbers.. like this:
0 1 2 4 5 6
1 3 4 5 6 7
3 4 7 8 9 4
9 8 7 6 5 2
now, we give the target. For example index 2 4. (in this case is number 9 on that place) . Then I need to find cheaper way from index 0 0 to target on index 2 4 (always for one step) ... So in this case the program should go like that: 0, 1, 2, 4, 5, 9 (if we look numbers), or indexes( 0 0, 0 1, 0 2, 1 3, and finally 2 4). Then we need to find cheaper way back from target on index 2 4 to index 0 0 (on different way(we can not use the same places we had before)).. So the way back should be like that: 9, 8, 4, 3, 0(if we look numbers), or 2 4, 2 3, 1 2, 1 1 and 0 0(if we look indexes).
Any help will be appreciated.
ps: Like I sad, we speak different language here.. Because of that, I'm terrible with english language (I understand it very well, but I can not write it, because we have different expression here). I apologize for this.