From 3887e9d6bdd8f4322598025ac71b649bfb863daa Mon Sep 17 00:00:00 2001 From: chayan das Date: Fri, 5 Sep 2025 14:53:09 +0530 Subject: [PATCH] Create 3025. Find the Number of Ways to Place People I 1 --- ...ind the Number of Ways to Place People I 1 | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 3025. Find the Number of Ways to Place People I 1 diff --git a/3025. Find the Number of Ways to Place People I 1 b/3025. Find the Number of Ways to Place People I 1 new file mode 100644 index 0000000..69d6b94 --- /dev/null +++ b/3025. Find the Number of Ways to Place People I 1 @@ -0,0 +1,38 @@ +class compare +{ +public: + bool operator()(vector &x,vector &y) + { + if(x[0]==y[0]) return x[1]>y[1]; + return x[0]>& points) { + sort(points.begin(),points.end(),compare()); + int count=0; + for(int i=0;i=points[j][1]) + { + valid=true; + } + else continue; + for(int k=i+1;k=points[k][1] && points[k][1]>=points[j][1] ) + { + valid=false; + break; + } + } + if(valid) count++; + } + } + return count; + } +};