(FAANG) Get the Minimum value of Maximum values of 2D matrix Path
Anonymous User
1474

I've 2D matrix of integers, I will start from the begining of the matrix [0][0] till the end of it through many paths.
In each path I take the maximum value, and by the end get the mimumim value from all paths

For example:

  let's consider we have paths:
  
  int[][] grid= new int[][]{
				{1, 2, 3, 4},
				{12,14,15,16},
				{10,22,32,34},
				{9, 8, 7, 5},
		};
	
	path 1 => 1->2->3->4->16->15->14->12->10->9->8->7->5 , max value  = 16
	path 2 => 1->2->3->4->16->34->5 , max value  = 34
	path 3 => 1->12->10->9->8 ->7->5, max value = 12
	.... etc

then the min value here = 12

Comments (7)