Ad
  • Default User Avatar

    More code BUT definitely more optimal than 99% of the solutions here. Optimal is the way !!

  • Default User Avatar

    Nice simple 1 liner BUT certainly not optimal.

    Most solutions here parse through the entire collection and are far from optimal. What if the collection contained a file with 10 trillion numbers and the offending number was 4th on the list or worse 1st on the list. Why parse a collection that big only to discover the offending number was 1st on the list ?

    Rather a few more lines of code.

  • Default User Avatar

    Nice solution. Good one. I'm totally rubbish at regex and used Linq instead. Your solution actually taught me a thing or two I could not find anywhere.

  • Default User Avatar

    An extra test case would rule out some of the solutions. So if you input "jack and jill" the answer would be "Jack And Jill". But if I input "jack aNd jill" the answer should still be "Jack And Jill". Some of the solutions dont pass this test. Or am I understanding the requirement incorrectly ?

  • Default User Avatar

    This does not work if the input is "jack aNd jill". it does not convert the N to a lower case letter.