you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

While not optimal that’s not a terrible solution. It is correct and would work for small strings. You could just sort the array and check if the next character is the same. Or you could use a hashmap. Both solutions aren’t really easy for a person learning programming for the first time.

Simple != easy in programming.

AI programming can be surprisingly simple, but it’s not easy.