Ad
  • Custom User Avatar

    It is not totally bad, but has some performance cave-ats which could be potentially improved.

    For example, how many times the s.lower() is called? It also does a lot of unnecessary work for inputs like "A" * 1000 + "B" * 1000 + "C" * 1_000 ... + "Z" * 1_000.

  • Custom User Avatar

    I see what you're saying ~ I apologize I didn't undertsand sooner. So, when I designed this kumite I was conceptulizing a very simple str formating exercise where the user had to strip dashes (-) from the input paramter before searching within the given constant PI (in the preloaded section) which only contains 1 million decimals. So becausse this given PI constant is finite, there are combinations of 6-8 digit numbers not found within it, as proven with the test cases. However, I concede to your point, true PI is infinte, and would be difficult to prove if a 6-8 digit number exitsed within it! Again, I apprecate the feedback!

  • Custom User Avatar

    Thanks for your feedback! Help me uderstand how does your code test for birthday in PI? The input paramter is a str, and your code will returns True no matter what the input argument is. For example, if the input value was "foo", then this code would return True, which is False because "foo" is not in PI, correct? Let me know if I am missing anything. Again, thanks for your feedback! ~ Respectfully.