You must Sign In to post a response.
  • Category: .NET

    Create a console application that receives any size of matrix and one parameter which is the Manhat

    Please choose coding language – C#

    Look for Manhattan distance in google.
    Create a console application that receives any size of matrix
    and one parameter which is the Manhattan distance, this is K.

    The result should be Yes/No.
    Yes if there are any two items (integers) in the matrix
    that are in a distance of K from each other or less.

    Input:
    1. Number of rows.
    2. Matrix rows one line after the other in a new
    line between each matrix line.
    3. K value.
    Output YES/NO

    Here is a sample for an input and output:

    3
    1 2 3 4 5
    8 7 6 9 2
    11 12 13 14 15 16
    2
    NO

    4
    1 2 3 4
    3 4 5 6
    6 5 4 3
    3
    YES


    Good luck,
  • #769317
    Its not clear, Can you give more details of this. So that we can try to solve the requirement
    By Nathan
    Direction is important than speed


  • Sign In to post your comments