Check if a String Contains only Identical Characters

Published by Helen Yu in

Write a function that returns true if all characters in a string are identical and false otherwise.

Examples

is_identical("aaaaaa") ➞ true

is_identical("aabaaa") ➞ false

is_identical("ccccca") ➞ false

is_identical("kk") ➞ true

Notes

N/A

Watch a quick demo on how Edabit works.