Mathematics
Mathematics, 24.06.2019 18:00, jakails7532

Your goal for this challenge will be to determine the optimal way to traverse a matrix, starting at one corner and ending at the center. for each n x n matrix of integers, where n is an odd integer and n > 1, you will be required to determine the optimal path beginning at any of its corners ( (0, 0), (0, n-1), (n-1, 0), (n-1, n-1) ) and ending at its center ( (n-1)/2, (n-1)/2) ), by moving vertically and horizontally. the value in each cell of the matrix represents the number of points you get from visiting the cell. a path is considered optimal if it accumulates the most points, given the following constraints: each path crosses as few cells in the matrix as possible each path prioritizes moving horizontally before moving vertically in cases where it would otherwise be indifferent in the case where there is a tie for the optimal path, return the path based on its starting corner, according to the following priority list (top of the list is preferable to bottom of the list): top-left corner top-right corner bottom-right corner bottom-left corner hint: because each path must reach the center having crossed as few cells as possible, there will only be two "valid directions" that a path can move in. these directions will be based on the path's starting corner. e. g., an optimal path that starts at the top-left corner will only move down and to the right.

answer
Answers: 1

Similar questions

Do you know the correct answer?
Your goal for this challenge will be to determine the optimal way to traverse a matrix, starting at...

Questions in other subjects:

Konu
Mathematics, 30.10.2020 03:00
Konu
English, 30.10.2020 03:00
Konu
History, 30.10.2020 03:00