Click here to see the full article post
my AC solution with DFS,similar to arppoach 1:
Maybe a missing test case mentioned in this post : https://leetcode.com/discuss/110931/a-missing-test-case
It seems that in ruby the DP approaches hit the time limit. Is it possible that it's incorrectly set for this problem?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.