Confluent interview question

Basic leetcode on searching algorithm