JAI interview question

coding on trees