ParentFull threadmbernstein·Recursion in this case - generally in ruby as well - is not a great idea. Also, you have quite high memory requirements: O(n^2)O(n) is quite easy in this problem.View on HN