diff --git a/1394. Find Lucky Integer in an Array b/1394. Find Lucky Integer in an Array new file mode 100644 index 0000000..147e3bf --- /dev/null +++ b/1394. Find Lucky Integer in an Array @@ -0,0 +1,27 @@ +class Solution { +public: + int findLucky(vector& arr) { + unordered_map map1; + + for(auto it : arr) + { + map1[it]++; + } + + + int count =-1; + + for(auto x : map1) + { + if(x.first == x.second) + { + count = max(count,x.first); + + } + } + + return count; + + + } +};