From 52fd8a94de22130a2e589e63a26d1b15dba79bda Mon Sep 17 00:00:00 2001 From: SjxSubham Date: Tue, 28 Oct 2025 23:08:53 +0530 Subject: [PATCH] Create 219. Containing Nearby Duplicate Problem.cpp --- 219. Containing Nearby Duplicate Problem.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 219. Containing Nearby Duplicate Problem.cpp diff --git a/219. Containing Nearby Duplicate Problem.cpp b/219. Containing Nearby Duplicate Problem.cpp new file mode 100644 index 0000000..8483b40 --- /dev/null +++ b/219. Containing Nearby Duplicate Problem.cpp @@ -0,0 +1,20 @@ +class Solution { +public: + bool containsNearbyDuplicate(vector& nums, int k) { + int n=nums.size(); + unordered_map indexmap; + + for(int i=0;i