IXL Learning Interview Question

LC med-hard question was asked