J.P. Morgan interview question

jumbled numbers coding exercise in java