<commit_before>#ifndef STR_UNIQUE_CHAR_HPP_
#define STR_UNIQUE_CHAR_HPP_





#endif /* STR_UNIQUE_CHAR_HPP_ */<commit_msg>Add solution for task 1.1 in CTIC using string and set<commit_after>#ifndef STR_UNIQUE_CHAR_HPP_
#define STR_UNIQUE_CHAR_HPP_

#include <iostream>
#include <string>
#include <set>

// Implement an algorithm to determine if a string has all unique characters.
// What if you cannot use additional data structures?

bool IsStrHasAllUniqueChars(const std::string& inputStr)
{
    if (inputStr.empty())
    {
        return (false);
    }

    std::set<char> characters;
    for (int i = 0; i < inputStr.size(); ++i)
    {
        if (0 == characters.count(inputStr.at(i)))
        {
            characters.insert(inputStr.at(i));
        }
        else
        {
            return (false);
        }
    }

    return (true);
}

#endif /* STR_UNIQUE_CHAR_HPP_ */
{'fraction_non_alphanumeric': 0.11098527746319366, 'fraction_numerical': 0.004530011325028313, 'mean_word_length': 2.826839826839827, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, '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': '2879465', 'n_tokens_mistral': 309, 'n_tokens_neox': 295, 'n_words': 75}