Remove Duplicates from Sorted Array II - allow duplicates at most twice