Hackerrank – Common Child

Problem Statement
A description of the problem can be found on Hackerrank.

Solution
The implementation according to Longest Common Subsequence Problem.

Ruby solutions is implemented with the same algorithm as Java solution. One hackerrank test with Ruby solution failed on timeout.

I created solution in:

All solutions are also available on my GitHub.

Java

Ruby