Rakuten interview question

Codility problem and behavioural questions already listed here