# Repeated character in a text with output boolean

jospercomp shared this question 1 year ago

How to create a function that determines if there is at least some repetition of some character in a text.

"ABA" is true

"ABC" is false

"121" is true

"123" is false.

`Length(TextToUnicode(text1))==Length(Unique(TextToUnicode(text1)))`

2

`Length(TextToUnicode(text1))==Length(Unique(TextToUnicode(text1)))`

1

Thank you so much!!!

1

Sort(RemoveUndefined(Flatten(Sequence(Sequence(Sequence(Sequence(

If( Length({a,b,c,d}) == Length(Unique({a,b,c,d})) &&

Sum(Sequence(Element({a,b,c,d}, i) < Element({a,b,c,d}, i + 1), i, 1, Length({a,b,c,d}) - 1, 1)) == 3

&& Sum(Sequence(Element({a,b,c,d}, i) == 4, i, 1, Length({a,b,c,d}), 1)) == 1,

{"" + (UnicodeToLetter(64 + a)) + "" + (UnicodeToLetter(64 + b))

+ "" + (UnicodeToLetter(64 + c))+ "" + (UnicodeToLetter(64 + d))})

, a, 1, 7), b, 1, 7), c, 1, 7), d, 1, 7))))

////////////////////////////////////////////////////////////////////

Sort(RemoveUndefined(Flatten(Sequence(Sequence(Sequence(Sequence(

If( Length({a,b,c,d}) == Length(Unique({a,b,c,d})) &&

Sum(Sequence(Element({a,b,c,d}, i) < Element({a,b,c,d}, i + 1), i, 1, Length({a,b,c,d}) - 1, 1)) == 3,

{"" + (UnicodeToLetter(64 + a)) + "" + (UnicodeToLetter(64 + b))

+ "" + (UnicodeToLetter(64 + c))+ "" + (UnicodeToLetter(64 + d))})

, a, 1, 7), b, 1, 7), c, 1, 7), d, 1, 7))))

////////////////////////////////////////////////////////////////////

Sort(RemoveUndefined(Flatten(Sequence(Sequence(Sequence(Sequence(

If( Length({a,b,c,d}) == Length(Unique({a,b,c,d})),

{"" + (UnicodeToLetter(64 + a)) + "" + (UnicodeToLetter(64 + b))

+ "" + (UnicodeToLetter(64 + c))+ "" + (UnicodeToLetter(64 + d))})

, a, 1, 7), b, 1, 7), c, 1, 7), d, 1, 7))))

2

In some cases, the following version is helpful: