Below is the code that reads a string from the standard input and calculates the number of distinct characters in the string. For some reason, the developer Rebecca decided to perform calculations in a new thread. Sadly, her solution doesn't work correctly. Try to fix it.
Additional explanations: the implemented class SlowStringProcessor extends Thread and overrides the method run(). It calculates the number of distinct characters passed to the constructor. The class has a field NumberOfUniqueCharacters that contains the calculated number or 0 if the thread has not calculated the number yet. Keep in mind that SlowStringProcessor works quite slow.