MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply TodayOne 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: http://en.wikipedia.org/wiki/Pareto_optimal 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.

12 correct solutions
10 incorrect solutions

Last solution submitted on Aug 15, 2014

2 Comments