microsoft interview question, more than half in array