Infibeam Avenues interview question

basic swift questions and code solving