JPMorganChase interview question

They asked me to write basic algoithm based code