Galadrim Interview Question

code a function in a given situation and develop it more