Galadrim interview question

code a function in a given situation and develop it more