int main()
{
    // test some arbitrary strings
    char* testStrings[5] = {"abcde", "hello", "apple", "kite", "padle"};
    for (int i = 0; i < 5; i++)
        // print the string followed by whether or not it has all unique characters
        printf("%s: %s\n", testStrings[i], isUniqueChars(testStrings[i]) ? "true" : "false");
    return 0;
}
示例#2
0
文件: test.cpp 项目: njir/codeforces
TEST(UniqueCharsTest, Falsecase) { 
    ASSERT_EQ(false, isUniqueChars("aaaaa"));
    ASSERT_EQ(false, isUniqueChars("bvbbbdsfsafcdsvsa"));
}
示例#3
0
文件: test.cpp 项目: njir/codeforces
TEST(UniqueCharsTest, TrueCase) { 
    ASSERT_EQ(true, isUniqueChars("ga"));
    ASSERT_EQ(true, isUniqueChars("abcdefghijk"));
}