Fixed MyFindCommonAncestor by using O(n) approach with a boolean array, and changed the StringBuilder to a HashSet.