From 3568e8cca6eb145f2f272dd6d299f70e71631df7 Mon Sep 17 00:00:00 2001 From: Mhrooz Date: Fri, 24 Nov 2023 11:05:17 +0100 Subject: [PATCH] 2699 is waiting to be solved --- .gitignore | 2 ++ 2699-231124/main.cpp | 12 ++++++++++++ 2824-231124-pass/main.cpp | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 .gitignore create mode 100644 2699-231124/main.cpp create mode 100644 2824-231124-pass/main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3126d03 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +main +.vscode diff --git a/2699-231124/main.cpp b/2699-231124/main.cpp new file mode 100644 index 0000000..38ae9c0 --- /dev/null +++ b/2699-231124/main.cpp @@ -0,0 +1,12 @@ +#include +using namespace std; +class Solution{ +public: + vector> modifiedGraphEdges(int n, vector>& edges, int source, int destination, int target){ + + } + +} +int main(){ + +} \ No newline at end of file diff --git a/2824-231124-pass/main.cpp b/2824-231124-pass/main.cpp new file mode 100644 index 0000000..b318f64 --- /dev/null +++ b/2824-231124-pass/main.cpp @@ -0,0 +1,34 @@ +#include +using namespace std; + +class Solution{ +public: + int countPairs(vector& nums, int target){ + const int array_length = 60; + const int nums_length = nums.size(); + int sums[array_length][array_length]; + int rlt = 0; + for(int i = 0 ; i < nums_length;i++){ + for(int j = i + 1; j < nums_length; j++){ + if(nums[i]+nums[j] < target){ + rlt++; + } + } + } + return rlt; + } +}; + +int main(){ + Solution example; + int target = 0; + vector ex1 = {-1,1,2,3,1}; + target = 2; + cout< ex2 = {-6,2,5,-2,-7,-1,3}; + target = -2; + cout<