This Challenge is derived from GJam 2013 Veterans Ocean View. This is the Small data set witn N<=50 and Q<=4, guaranteed.
The GJam story goes that as Supreme Ruler you are annoyed by complaints of non-ocean views on a hillside. To resolve the issue a minimum number of homes will be removed to provide a maximum number of ocean view homes. The Elevation of the homes should monotonically increase, no equal values, from element 1 thru the end.
Succinct Challenge statement: Given a vector create the maximum length monotonically increasing vector by removing values. Report the number of values removed.
Input: V , Vector length N<=50 with values 1 thru 1000.
Output: Q , minimum quantity of removed values to produce a valid vector [0:4]
Examples: [V] [Q]
[1 4 3 3] [2] for [1 4] or [1 3] [1 2 3 4 5] [0] [4 3 2 1] [3]
Commentary:
1) The GJam Small test suite is not robust 2) nchoosek(50,4) is too slow for Cody and the 100 cases 3) The Large test suite is N<=1000 with some delete cases >4 4) A Good Algorithm that solves the Large case is usually best to pursue 5) GJam Competition allows one Large submission within 10 minutes of download 6) <Large Suite Challenge>
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers18
Suggested Problems
-
824 Solvers
-
465 Solvers
-
Detect a number and replace with two NaN's
199 Solvers
-
Sum the elements in either diagonal of a square matrix
221 Solvers
-
Create an n-by-n null matrix and fill with ones certain positions
718 Solvers
More from this Author309
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!