#Java //Could not use any import// Your program will take a six-dimensional integer array as input. Each element represe
Posted: Sun May 15, 2022 1:31 pm
#Java
//Could not use any import//
Your program will take a six-dimensional integer array as
input.
Each element represents a smartphone model which contains six
features (e.g., screen size and performance ranking).
Please return an sorted array containing a list of unbeatable
smartphone models (In other words, filter out the phone models that
can be beaten by some model).
The return array should be sorted by the first element of each
array in the output.
A =(X1, X2,X3,X4,X5,X6) and B =(Y1, Y2, Y3, T4, Y5, Y6), Item A
beats Item B if X1≥Y1 & X2≥Y2 &
X3≥Y3 & X4≥Y4 & X5≥Y5 & X6≥Y6
public abstract class Buy_Phone_v2{
public abstract int[][] bestPhone(int[][]
inputArr);
}
Example:
Input: [[8,7,7,4,2,1],[2,4,4,6,2,1],[4,0,5,1,3,2],[5,2,4,3,7,3],[7,5,6,9,8,9]] Output: [[7,5,6,9,8,9),[8,7,7,4,2,1]]
//Could not use any import//
Your program will take a six-dimensional integer array as
input.
Each element represents a smartphone model which contains six
features (e.g., screen size and performance ranking).
Please return an sorted array containing a list of unbeatable
smartphone models (In other words, filter out the phone models that
can be beaten by some model).
The return array should be sorted by the first element of each
array in the output.
A =(X1, X2,X3,X4,X5,X6) and B =(Y1, Y2, Y3, T4, Y5, Y6), Item A
beats Item B if X1≥Y1 & X2≥Y2 &
X3≥Y3 & X4≥Y4 & X5≥Y5 & X6≥Y6
public abstract class Buy_Phone_v2{
public abstract int[][] bestPhone(int[][]
inputArr);
}
Example:
Input: [[8,7,7,4,2,1],[2,4,4,6,2,1],[4,0,5,1,3,2],[5,2,4,3,7,3],[7,5,6,9,8,9]] Output: [[7,5,6,9,8,9),[8,7,7,4,2,1]]