Max len substring with atmost M unique chars