Datadog interview question

Phone Screen - two Leetcode questions (Easy-mid) with Follow up