Rakuten Interview Question

Codility problem and behavioural questions already listed here