[ANSWERED] Finding a specific element in a vector
I'm having problems with the following code. The code is meant to generate ranks of number listed in a vector. Allow me to describe the problems. 1. I try to use std::lower_bound to find a specific number, I do this in attempt to deduce the rank of the number in another vector, which is sorted in descending order. But I can't make it work except the vector is sorted in ascending order. 2. Then I try to use std::find which works for me, but I was getting the impression that I would do better with std::lower_bound because the latter is said to perform better with a sorted container. Read the next for a question in regards to std::find. 3. std::find is giving me the same result when there are similar numbers in the vector. How do I get different result? as I need to figure out the index of the number which obviously be different. Here is the code, please help with suggestions, corrections or links to guide me. T.I.A 🙏 https://code.sololearn.com/cbhXoI4R4eRU/?ref=app