MaximumPathSumTwo and DistinctPowers