#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]]
#Java //Could not use any import// Your program will take a six-dimensional integer array as input. Each element represe
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
#Java //Could not use any import// Your program will take a six-dimensional integer array as input. Each element represe
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!