leastCostPathNoBlocks function

Extracts the least-cost from a least cost matrix by trimming blocks.