diff --git a/Count the number of fair prices b/Count the number of fair prices new file mode 100644 index 00000000..880b1d18 --- /dev/null +++ b/Count the number of fair prices @@ -0,0 +1,18 @@ +A VERY NICE implementation of BINARY SEARCH TO BE LEARNT HERE + +class Solution { +public: + long long countFairPairs(vector& nums, int lower, int upper) { + long long int ans = 0; + sort(nums.begin(),nums.end()); + for(int i=0;i