From 09fcde191ec62d632da136bad685fa23dd3a15b1 Mon Sep 17 00:00:00 2001 From: Xtha-Sunil Date: Wed, 30 Oct 2024 23:26:04 +0545 Subject: [PATCH] Added solution for find missing and repeated values. --- C++/find-missing-and-repeated-values.cpp | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 C++/find-missing-and-repeated-values.cpp diff --git a/C++/find-missing-and-repeated-values.cpp b/C++/find-missing-and-repeated-values.cpp new file mode 100644 index 0000000..2b84fed --- /dev/null +++ b/C++/find-missing-and-repeated-values.cpp @@ -0,0 +1,26 @@ +class Solution { +public: + vector findMissingAndRepeatedValues(vector>& grid) { + int n = grid.size()*grid.size(); + int *nums = new int[n]; + for(int i=0; i res = {-1, -1}; + + for(int i=0; i