We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
what is the prolem with my code it passes all the test casses except three cases.
#include<cmath>#include<cstdio>#include<vector>#include<iostream>#include<algorithm>usingnamespacestd;intmax(inta,intb){returna>b?a:b;}intmain(){strings2,s1;inta[123]={0},b[123]={0},cnt=0;cin>>s1>>s2;for(intj=0;j<max(s1.size(),s2.size());j++){a[s1[j]]++;b[s2[j]]++;}for(intj=97;j<123;j++)if(a[j]!=b[j])cnt+=abs(a[j]-b[j]);cout<<cnt;/* Enter your code here. Read input from STDIN. Print output to STDOUT */return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Making Anagrams
You are viewing a single comment's thread. Return to all comments →
what is the prolem with my code it passes all the test casses except three cases.