Skip to content

Instantly share code, notes, and snippets.

@bebyx
Created January 16, 2021 22:01
Show Gist options
  • Save bebyx/4e3ec4e65d1113620ee8786fd216286f to your computer and use it in GitHub Desktop.
Save bebyx/4e3ec4e65d1113620ee8786fd216286f to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
char* check_uniqueness(const char *chars);
int main() {
char chars[100] = "";
char buffer[100] = "";
scanf("%s", chars);
printf("%s", check_uniqueness(chars));
return 0;
}
char* check_uniqueness(const char *chars) {
for (int i = 0; i < strlen(chars); i++) {
if (strchr(&chars[i+1], chars[i])) {
return "Deja Vu";
}
}
return "Unique";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment