Problem 586. All Humans are Created Equal - Pareto Equality

One way or the other two sets of identical types can come out ahead of the other by idea of Pareto equality. Pareto equality between two sets, or a group of sets, requires that atleast one element of each set is ranked higher than its corresponding element of the other set. Please see: for more information.

Build a function to take two cell-args, and return a boolean value true/false, to indicate their pareto equality.

Ex. >> ispareto( {1,'foo',40}, {0,'bar',30}) = true

    >> ispareto( {2,-10,'z'},{0,-9,'t'}) = false

Cell-array can have only numbers and strings. Use natural comparison functions for numbers (a>b), while strings have 'a' > 'z' kind of comparison.

Next, generalize this function to work with varargs, and see if the entire set is pareto optimal.

Two or more arguments will always be supplied.

Solution Stats

46.88% Correct | 53.13% Incorrect
Last Solution submitted on May 30, 2020

Problem Comments