Skip to content

Instantly share code, notes, and snippets.

@ajinkya933
Created January 2, 2017 18:39
Show Gist options
  • Save ajinkya933/17501cb4a66e311b8e19ac4698d4604a to your computer and use it in GitHub Desktop.
Save ajinkya933/17501cb4a66e311b8e19ac4698d4604a to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
using namespace std;
bool IsCharDuplicate(string s)
{
for (int i = 0 ; i < s.length(); i++)
for (int j = i+1; j <s.length() ; j++)
if (s[i]==s[j])
return true;
return false;
}
int main() {
string s= "Ajinkya";
IsCharDuplicate(s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment