Author: Amanpreet Kapoor
Difficulty: Easy
Write a function that takes in two parameters:
container: a vector of stringstarget: a single string
The function should check if the target exists in the container and return a boolean value indicating the result.
container: ["apple", "banana", "mango", "kiwi", "strawberry"]
target: "mango"
true
The function checks if the target string "mango" is present in the container. Since it is, the output is true.
containercontains at least one stringtargetis a non-empty string- No strings include newlines or whitespace characters
- Search is case-sensitive
This project is open source under the MIT License.