Amazon interview question

non repeatable character, python functions