JPMorganChase Interview Question

They asked me to write basic algoithm based code