LEETCODE search-insert-position Solution

| August 01, 2015

The correct, optimal and working solution for programming question search-insert-position on leetcode

#include <algorithm>

class Solution {
public:
    int searchInsert(int A[], int n, int target) {
        return (lower_bound(A,A+n,target) - A);
    }
};