• ###### anter69commented on "What's the real floor?" python solution

Yes, you can chain as many as you like

• ###### bertram___rayhancommented on "What's the real floor?" python solution

wait what, we can make 2 if statement in one line???

• ###### 0xdvcommented on "You are a Cube!" python solution

this kata makes me feel bad :(

• ###### Bouhdydcommented on "String repeat" python solution

men i love using lambda ;)

• ###### prog109commented on "Exclamation marks series #11: Replace all vowel to exclamation mark in the sentence" python solution

Since every character in the string has to be touched, assuming 'n' refers to the size of 'aeiouAEIOU' -> 10

String comparison method:

vowel, equal frequencies: 5.5 checks

not a vowel: 10 checks, constant

Set, assuming underlying b-tree has minimal depth:

vowel, equal frequency: 1 * .1 + 2 * .2 + 3 + .4 + 4 * .3 = 2.9 checks

not a vowel: upper bound of 4 checks, lower bound 3 checks

Comparing: vowel 5.5 vs 2.9 -> ~1.90 faster for set

not a vowel: 10 vs 3 to 4 -> 3.33 to 2.5 times faster, in theory

Note: this is in theory, the python interpreter and execution environment could make this worse or better

Obviously as 'n' gets (not much) larger, the set is going to be faster. For n = 10, I would say tradeoff is speed versus speed of coding

• ###### evan.krozcommented on "Exclamation marks series #11: Replace all vowel to exclamation mark in the sentence" python solution

Can someone please explain what is happening here?
And why the time complexity of this solution is O(n)?

• ###### goldenratio161commented on "Boolean logic from scratch" python solution

wow, that's big brain

frrr

• ###### leishaozaicicommented on "Number Format" python solution

so good format function not use regular expression

• ###### Taky0nDoncommented on "Number Format" python solution

youve got to be kidding me

• ###### Taky0nDoncommented on "Inserting multiple strings into another string" python solution

This comment is hidden because it contains spoiler information about the solution

• ###### zbz000commented on "Factorial Factory" python solution

the in-build factorial function of math includes that case

• ###### zbz000commented on "Plural" python solution

I think this is more correct because the input can be a negative number.
And -1 is not used for plurals

• ###### Apkaguucommented on "Odd or Even?" python solution

Если честно, я совсем ничего не понял. Ну, да ладно может со временем разберусь.

gotcha.