diff --git a/09. Hashing/first_repeating_element.cpp b/09. Hashing/first_repeating_element.cpp new file mode 100644 index 00000000..1e69d1f0 --- /dev/null +++ b/09. Hashing/first_repeating_element.cpp @@ -0,0 +1,18 @@ + +class Solution { + public: + // Function to return the position of the first repeating element. + int firstRepeated(int arr[], int n) { + // code here + unordered_map m; + for(int i=-1;i1){ + return arr[i]; + } + } + return -1; + } +};