First version of the Remove duplicates from sorted array problem