go leetcode string array linked list n tree sort search divide and conquer dynamic programming algorithm