different people. You do this because you want to place as large a subset of people as possible into a sequence whose foot sizes are increasing but IQs are decreasing.
Some people think that the bigger the size of a person's foot,the smarter he/she is. To disprove this,you want to analyze a collection of foot size/IQ measurements fromThe following line text file contains the data of the test subjects.
Find the length of the largest subset of people in a sequence such that their foot sizes are strictly increasing and IQ is strictly decreasing .
Details and assumptions
Each line in the text file contains a string where is the length of the subject's foot and is his\her IQ.
Two people may have the same foot size, the same IQ, or even the same foot size and IQ.
All the measurements between and assume this is because weird units were used.
Sample Input
If the following (foot size, IQ data) for four people was given
1. (108,169)
2. (188,249)
3. (284,140)
4. (104,275)
The largest possible subset of people into a sequence whose foot size's are increasing but IQs are decreasing would be . And thus the length of the sequence would be .
Inspired from UVA problem
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Here is a solution is python 3.4: