Skip to main content
added 17 characters in body
Source Link

J (149)

Assumes the value to be tested is in variable b (I know this can be made into a function, but don't have a clue on how. J is confusing. Any help on this is appreciated)(I know this can be made into a function, but don't have a clue on how. J is confusing. Any help on this is appreciated) Thanks Marinus!

(#b)=#~.b=-:"~.)@":b

Checks if the lenght of the string rep of the number with all the duplicates removed is the same as the lenght of the regular string rep.

J (14)

Assumes the value to be tested is in variable b (I know this can be made into a function, but don't have a clue on how. J is confusing. Any help on this is appreciated)

(#b)=#~.b=:":b

Checks if the lenght of the string rep of the number with all the duplicates removed is the same as the lenght of the regular string rep.

J (9)

Assumes the value to be tested is in variable b (I know this can be made into a function, but don't have a clue on how. J is confusing. Any help on this is appreciated) Thanks Marinus!

(-:~.)@":

Checks if the lenght of the string rep of the number with all the duplicates removed is the same as the lenght of the regular string rep.

Source Link

J (14)

Assumes the value to be tested is in variable b (I know this can be made into a function, but don't have a clue on how. J is confusing. Any help on this is appreciated)

(#b)=#~.b=:":b

Checks if the lenght of the string rep of the number with all the duplicates removed is the same as the lenght of the regular string rep.