three solutions ep. memoization of pascal triangle