Criteo Interview Question

Write code for: Ransom note (from cracking the coding interview) Moving average