Optum Interview Question

Print subsequence of given array