You are viewing a single comment's thread. Return to all comments →
Here are my c++ solutions, you can watch the explanation here : https://youtu.be/teDaBhua0bc
solution 1:
int introTutorial(int V, vector<int> arr) { for(int i = 0; i < arr.size(); i++) if(arr[i] == V) return i; return 0; }
solution 2:
int introTutorial(int V, vector<int> arr) { return distance(arr.begin(), find(arr.begin(), arr.end(), V)); }
Seems like cookies are disabled on this browser, please enable them to open this website
Intro to Tutorial Challenges
You are viewing a single comment's thread. Return to all comments →
Here are my c++ solutions, you can watch the explanation here : https://youtu.be/teDaBhua0bc
solution 1:
solution 2: