Intro to Tutorial Challenges

  • + 0 comments

    Iterative solution with built-in functions

    int introTutorial(int V, vector<int> arr) {
        auto it = std::find(arr.begin(), arr.end(), V);
        if (it != arr.end()) return std::distance(arr.begin(), it);
        return -1;
    }