Solve increasing sequence and path problems | Meta Interview Question