IBM Interview Question

2 LC easy medium questions