Adobe interview question

2 lc medium and ML questions