answer1 :: IO ()
answer1 =
    let
        target = sum weights `quot` 3
        firstGroups =
            sortOn (length . fst) $ selectTarget target weights
        validFirstGroups =
            filter (\(g, rs) -> not . null $ selectTarget target rs) firstGroups
        bestFirstSize = length . fst $ head validFirstGroups
        candidates    = takeWhile ((<=bestFirstSize) . length)
            $ map fst validFirstGroups
    in
        print $ minimum $ map product candidates
answer1 :: IO ()
answer1 =
    let
        target = sum weights `quot` 3
        firstGroups =
            sortOn (length . fst) $ selectTarget target weights
        validFirstGroups =
            filter (\(g, rs) -> not . null $ selectTarget target rs) firstGroups
        bestFirstSize = length . fst $ head validFirstGroups
        candidates    = takeWhile ((<=bestFirstSize) . length)
            $ map fst validFirstGroups
    in
        print $ minimum $ map product candidates
answer1 =
    let
        target = sum weights `quot` 3
        firstGroups =
            sortOn (length . fst) $ selectTarget target weights
        validFirstGroups =
            filter (\(g, rs) -> not . null $ selectTarget target rs) firstGroups
        bestFirstSize = length . fst $ head validFirstGroups
        candidates    = takeWhile ((<=bestFirstSize) . length)
            $ map fst validFirstGroups
    in
        print $ minimum $ map product candidates