Created
January 2, 2017 18:39
-
-
Save ajinkya933/17501cb4a66e311b8e19ac4698d4604a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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