<commit_before>//
//  main.c
//  unique-characters
//
//  Created by <NAME> on 8/20/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

#include <stdio.h>

void printCharacters(char *inputString) {
    int dictinary[30] = {};

    while (*inputString) {
        dictinary[(int) *inputString]++;
        printf("Current character is: %c\n", *inputString);

        inputString++;
    }
}

int main(int argc, const char * argv[]) {
    void printCharacters(char *inputString);
    char inputString[80] = {};

    printf("Please enter your string: ");
    scanf("%s", inputString);

    // build a hash table with caracters
    printCharacters(inputString);

    printf("Your string is: %s\n", inputString);

    return 0;
}
<commit_msg>Check if a string has all unique characters algorithm<commit_after>//
//  main.c
//  Check if a string has all unique characters by counting how many times each character appears using its ASCII code
//
//  Created by <NAME> on 8/20/17.
//  Copyright © 2017 <NAME>. All rights reserved.
//

#include <stdio.h>

_Bool isUniqueChars(char *str) {
    int frequencyDictionary[127] = {};

    while(*str) {
        frequencyDictionary[(int) *str]++;

        if (frequencyDictionary[(int) *str] > 1) {
            return 0;
        }

        str++;
    }

    return 1;
}

int main(void) {
    _Bool isUniqueChars(char *string);
    char inputString[127] = {};

    printf("Please enter your string: ");
    fgets(inputString, 128, stdin);

    printf("This string with %s\n", isUniqueChars(inputString) ? "unique characters." : "duplicates.");

    return 0;
}

{'fraction_non_alphanumeric': 0.14455569461827283, 'fraction_numerical': 0.02252816020025031, 'mean_word_length': 2.8162291169451072, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7476090', 'n_tokens_mistral': 538, 'n_tokens_neox': 489, 'n_words': 148}