Solves the optimisation partition problem (NP-hard) in pseudopolynomial time NM where N is size of the list and M is the sum of the elements in the list. Implemented in Haskell with a memoisation "trick".
mindiff takes a list and calculates the minimum difference between the sum of partitions of the list into two lists.