Saturday, 10 August 2013

Finding the largest resolution from set of resolution

Finding the largest resolution from set of resolution

I have set of strings like the following:
1024 x 768
1280 x 960
1280 x 1024
1280 x 800 widescreen
1440 x 900 widescreen
1680 x 1050 widescreen
How to I discover the largest resolution of it? By largest I mean the one
with the highest height and longest width. In above case 1680 x 1050 is
the largest as it has the highest dimensions and we can create all other
resolution from it.
My plan of action to solve this was to take out the resolution values, but
I only simple regex and it is not enought to extract the resolution out.
Then I do not know how to use the height and width to determine the
largest resolution dimensions.

No comments:

Post a Comment