Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Hi there, cool kumite! Perhaps you should update the instructions to include: 'If a copy of special is already in the array, then remove it before inserting special again and then return the new array.'
Hmph, I think my version is way faster than yours! 😁
Cool! 👍
Great job!
Thanks for the catch!
Pretty clever useage!
You have to add test cases
If the input array represents the durations of songs in
seconds
of each song, and there is1
minute between each song, how does[420, 180, 360, 240, 120, 240, 300, 180] equal
59 minutes and 15 seconds
? The sum of the array is2040
seconds +7
minutes, (or420
seconds) for time between songs equals2460
seconds or41
minutes, correct? Likewise with the third example: [300, 240, 480, 180, 240, 240, 300, 360], how did this calculate to57 minutes and 40 seconds
? ~ Thanks for any clarification!Thank you for your feedback! I may be over looking what you're trying to explain. On line
533
of your example,str = None
is applied to_field_no_pipe
in thehelp
doctstring when you use therich.inspect(, help=True)
method on theui
object, no?So, are you referring to the print out on line
535
of your example:'_field_no_pipe', <class 'str'>
? This is where you feel it should displaystr | None
instead, so future developers will know this field type can beNone
as well, correct? However, this is the objtype
and not thehelp
doctstring of the obj, correct? Again, thank you for feedback!Thanks for the feedback. According to the Python docs, it uses this
| None = None
typehint only forInit-only
variables. Please let me know your feedback if you agree or disagree ~ thanks!You lose ~ 56 chars!😜
I agree, this looks a lot better! However, you're still using a nested
for-loop
regardless of inverting the condition.Good catch! According to StackOverflow,
O(n) + O(n log(n)) = O(n log(n))
. For Big O complexity, all that matters is the dominant term.n log(n)
dominatesn
in this situation therefore, that's the only term that matters (source).The time complexity of the
map()
function isO(n)
.The reason that we don't use constants with big O notation is because, theoretically they don't matter much. What we are calculating with time-complexity is the speed at which something will grow, having a constant on there will be completely irrelevant when a large enough input is used
Loading more items...