Rakuten interview question

easy-medium algorithm question + general technical question