DAILY LEETCODE SOLUTION || EASY C++ SOLUTION
\nconst int MOD=1e9+7;\nclass Solution {\npublic:\n    long long powr(long long a,long long b){\n        long long res=1;\n        while(b){\n            if(b&1
```\nconst int MOD=1e9+7;\nclass Solution {\npublic:\n    long long powr(long long a,long long b){\n        long long res=1;\n        while(b){\n            if(b&1) res=(res*a)%MOD;\n            a=(a*a)%MOD;\n            b=b>>1;\n        }\n        return res;\n    }\n    int lowerBound(vector<int>& nums,int target){\n        int n=nums.size();\n        int s=0,e=n-1,res=n;\n        while(s<=e){\n            int mid=s+(e-s)/2;\n            if(nums[mid]==target){\n                res=mid;\n                s=mid+1;\n            }\n            else if(nums[mid]<target){\n                res=mid;\n                s=mid+1;\n            }\n            else{\n                e=mid-1;\n            }\n        }\n        return res;\n    }\n    int numSubseq(vector<int>& nums, int target) {\n        int n=nums.size();\n        long long res=0;\n        sort(nums.begin(),nums.end());\n        for(int i=0;i<n;i++){\n            int num=target-nums[i];\n            int idx=lowerBound(nums,num);\n            if(idx<n){\n                if(idx>=i){\n                    res=(res+powr(2,idx-i))%MOD;\n                }\n            }\n        }\n        return (int)res;\n    }\n};\n```
['Array', 'Two Pointers', 'C', 'Sorting', 'Binary Tree']