Frage im Vorstellungsgespräch bei Xoriant

in coding round They asked two que based on array and string. In array take odd no. from user stop when negative no. came print only the smallest odd no.