Adobe Interview Question for Software Engineer / Developers
- 0of 0 votes
AnswersA matrix will be given which contains nos. and dots. will have to output another matrix in which the nos. are surrounded by single loop. the value of each number in a matrix equals the number of lines surrounding it.
- im.akki90 May 23, 2014 in India
Empty spaces in matrix/dots may be surrounded by any number of lines.
When completed, the solution forms a single continuous loop with no crossings or branches.
Value of each no. should connect the adjacent dots horizontally and vertically so that the lines form a simple loop with no loose ends based on the above rules.
eg
input Matrix
1.31.3
...3..
.3.21.
.02.1.
..2...
2.23.3
output Matrix
- -
1 .|3|1 .|3|
- - | - |
|. . .|3|. .|
| - - -
|.|3|. 2 1|.
- - - _
. 0 2 .|1 .|
- - - -
|.|.|2 . .|.
| - - -
|2 . 2|3|. 3|
- - - - -
i tried making rules and then call the function to make lines, but couldnt succeed in gettin desired output.
for any queries please comment| Report Duplicate | Flag | PURGE
Adobe Software Engineer / Developer Java
Interview Type: Written Test