Sobes.tech
Junior — Senior

Finding the position of an element in std::vector using std::optional

livecode

Task condition

It is necessary to implement a function that searches for the index of a given number in a provided vector and returns it as std::optionalstd::size_t. If the element is not found, the function should return an empty optional.

std::optional<std::size_t> find_index_n(const std::vector<int>& arr, int value)
{

}