Implement a thread-safe Singleton design pattern.
Asked in the Round 3 - Hiring Manager stage. This was one of several fundamentals evaluated, along with API design, abstract classes vs interfaces, and exception handling.
Implement singleton_ids(thread_count). It must lazily create one shared Singleton instance, start thread_count threads, obtain the instance once per thread, and return the number of distinct instance identities observed.
thread_count.1 for every valid input.def singleton_ids(thread_count):