diff --git a/1 June Odd Even Problem b/1 June Odd Even Problem new file mode 100644 index 00000000..39204899 --- /dev/null +++ b/1 June Odd Even Problem @@ -0,0 +1,27 @@ +class Solution { + public: + string oddEven(string s) { + // code here + unordered_map mpp; + for(int i=0;i v; + + int x=0,y=0; + for(auto it : mpp) + { + int z=it.first-'a'; + if((z+1)%2==0 && it.second%2==0) + { + x++; + } + else if((z+1)%2!=0 && it.second%2!=0) + { + y++; + } + } + return (x+y)%2==0?"EVEN":"ODD"; + } +};