UST Interview Question

1 coding question based on collection String, Springboot Java oops