From 272618206ab0c02bd43563126abd7032379cbd0d Mon Sep 17 00:00:00 2001 From: chayan das <110921638+Chayandas07@users.noreply.github.com> Date: Sat, 1 Jun 2024 22:44:11 +0530 Subject: [PATCH] Create 1 June Odd Even Problem --- 1 June Odd Even Problem | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 1 June Odd Even Problem 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"; + } +};