Meta Interview Question

Random pick index leetcode question