Question icon
Grade 12th passAlgebra

I have two dimensional integer array x, y as below
{1160, 0},
{1560, 400},
{11940, 10380},
{12480, 540},
{12540, 60},
{12600, 60},
{12720, 120},
{13120, 400},
{13380, 260},
{13680, 300},
{14000, 320}

I need to pick {13120, 400} since x is highest as well as y is highest when comparing with other y elements matching with x highest value. I am doing this in VB.NET. Your help is greatly appreciated. Thanks.

Profile image of Rajaram
9 Years agoGrade 12th pass
Answers icon

1 Answer

Profile image of Saurabh Koranglekar
7 Years ago
Dear student

An attempt for algorithm can be made as follows

consider 1 as highest

compare and replace (change in x) + (change in y) for all array elements when greater

else ignore and next check