Skip to content

Instantly share code, notes, and snippets.

@hamzahasbi
Last active October 30, 2016 01:52
Show Gist options
  • Select an option

  • Save hamzahasbi/ec078a4421272972f46308e263ed3d31 to your computer and use it in GitHub Desktop.

Select an option

Save hamzahasbi/ec078a4421272972f46308e263ed3d31 to your computer and use it in GitHub Desktop.
map<int,bool>mark;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
if(abs(a[i]-b[j])<=1)
{
if(!mark[j] )
{
c++;mark[j]=true;
break;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment