2018.10.04 Square Pasture
USACO Bronze December 2016, Question 1.
Square Pasture. There are two rectangular pastures, each given by the coordinates of their upper left and lower right points. The two pastures do not overlap. Find the minimum area required for a single square pasture to enclose the two rectangle pastures.
sqPasture :: ((Int,Int),(Int,Int)) -> ((Int,Int),(Int,Int)) -> Int
sqPasture ((x1,y1),(x2,y2)) ((x3,y3),(x4,y4)) = undefined
Additional Exercise
List run of 3. Given a list of
Int
, return true if the array contains either three even or three
odd values all next to each other. Lists of length less than 3 are
definitely false because they don’t even have three values.