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.
x = "a and b"
whereGCD(a,b) != 1
(for examplem = 20, x = "2 and 4"
, it returned2 {8, 16}
instead of5 {4,8,12,16,20}
). The number should be divided byLCM(a,b)
instead ofa*b
.LCM(a,b)
should be(a*b)/GCD(a,b)
instead of iterating to nearest multiple ofa
andb
, imo.yeah, good Kata for data struchers, but description. also had to watch test> to understand.
You used my previous solution ;)
#you can use this code for less confusion
is_even = lambda a: a%2==0
0 is False and 1 is True
do you want it to return 0 when not even, and 1 when even?
Hello,
I don't know if it´s intended, but a function wrote in one single line is extremely difficult to read and understand what it is doing, mainly because of all the if-elses.
Damn i always forget to use the return of the sorted method, thanks for the tip :)
A tip: you could just replace
list
withsorted
to make it shortersort = lambda x: ''.join(sorted(filter(str.isalpha, x)) + sorted(filter(str.isdigit, x)))
And it's also sorting less element
*chef's kiss* now with 100% less
ord()
!My bad, gonna fix it now. Thanks!
Edit: Done! And added 2 more test case (0 and 100 USD)
Solution setup uses input of type
double
, and "Solution" snippet usesint
.Input should be (or even must be)
int
, notdouble
.Cool quotes
Any form of whitespace should only be removed if it is trailing behind the sentence
This solution teaches me how to use a made function (Not the lambda one) on an Arrays stream's map
Loading more items...