From dc9e30b79770ff2d863f175fbee78d9fe5704a26 Mon Sep 17 00:00:00 2001 From: chayan das Date: Tue, 2 Sep 2025 21:12:43 +0530 Subject: [PATCH] Create 3025. Find the Number of Ways to Place People I --- ... Find the Number of Ways to Place People I | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 3025. Find the Number of Ways to Place People I diff --git a/3025. Find the Number of Ways to Place People I b/3025. Find the Number of Ways to Place People I new file mode 100644 index 0000000..69d6b94 --- /dev/null +++ b/3025. Find the Number of Ways to Place People I @@ -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; + } +};