algorithm notes: leetcode#565 array nesting