Math, asked by abidaijaz3883, 9 months ago

Given a square matrix, find its top left right bottom number

Answers

Answered by kuldeep372
1

Answer:

what is the order of the matrix?

Answered by kuldeep9415193112
0

Step-by-step explanation:

Given a matrix of size N X M consisting of ‘#’, ‘.’ and ‘*’. ‘#’ means blocked path, ‘.’ means walkable path and ‘*’ means points that you have to collect. Now consider you are at the top left of the matrix. You have to reach the bottom right of the matrix and come back to the top left. When you are moving top left to bottom right, you are allowed to walk right or down. And when you are moving the bottom right to top left, you are allowed to walk left or up. The task is to find the maximum points you can grab during your whole journey. Points once taken will be converted into ‘.’ i.e walkable path.

Input : N = 3, M = 4

****

.##.

.##.

****

Output : 8

Input : N = 9, M = 7

*........

.....**#.

..**...#*

..####*#.

.*.#*.*#.

...#**...

*........

Output : 7

Similar questions