This was an interesting challenge for me, first of all because C# was not offered as an option for solving the problem and the problem itself was a nice brain puzzle. I managed to solve this with **Java** and **GoLang**

This is the problem description:

You are given a matrix A consisting of N rows and M columns, where each cell contains a digit. Your task is to find a continuous sequence of neighbouring cells, starting in the top-left corner and ending in the bottom-right corner (going only down and right), that creates the biggest possible integer by concatenation of digits on the path. By neighbouring cells we mean cells that have exactly one common side.

Write a function:

`class Solution { public String solution(int[][] A); }`

that, given matrix A consisting of N rows and M columns, returns a string which represents the sequence of cells that we should pick to obtain the biggest possible integer.

For example, given the following matrix A:

the function should return “997952”, because you can obtain such a sequence by choosing a path as shown below:

Write an **efficient** algorithm for the following assumptions:

- N and M are integers within the range [1..1,000];
- each element of matrix A is an integer within the range [1..9].

The challenge is still open so you can try it on the following link:

Based on the results of the solution here is my certificate

Happy coding,

J.

### Like this:

Like Loading...