Meta interview question

Easy array problem Easy greedy problem