Thursday, June 4, 2015

Haskell 99 Problem 17

Problem

Please find the problem here.

Solution:

Please see the solution as follow:

The basic recursion is to take the first element p and reduce the split index q and recurse, then just add back p in the first element of the sub-problem answer.

Was a bit lazy - didn't bother to differentiate different types of index out of range error.

No comments :

Post a Comment