Keysight Technologies Interview Question

2 coding questions - one on arrays and one DP