The $\texttt{lower_bound}$ function finds the first position where a value could be inserted in without breaking sorter order. Its time complexity is $\texttt{O(log n)}$. For example: $\texttt{it}$ refers to the address of the value. $\texttt{*it}$ refers to the value, and to get the index, use $\texttt{it-v.begin()}$.
