HCLTech interview question

Two online accessment coding questions. Not really challenge, but we need to do exercise via leetcode