Q2 Software Interview Question

Two sums dsa coding question