1

Find the first non repeating character in a given string. You may assume that the string contains any character from any language in the world, for e.g. an Arabic or Greek character even. I came across a solution using bit vectors for the above problem. It used a bit vector of size 95000. Can somebody please explain why this size is used?

user2714358
  • 565
  • 1
  • 5
  • 15
  • 1
    Probably because if you count all characters in all languages in the world, they will be less than 95000. – IVlad Sep 15 '13 at 19:58

1 Answers1

0

See How many characters can be mapped with Unicode? for part of an explanation.

According to that question, in Unicode 6.0, 109384 code points have been allocated. It's possible that, depending on how old the solution you found is, 95000 was large enough to hold all of the code points which had been allocated at that time, or that the author of your solution was happy with a "good enough" approach.

Community
  • 1
  • 1
Chris Hayes
  • 9,963
  • 4
  • 28
  • 44