Salesforce Interview Question

LC question easy and med difficulty