• ###### corebreakercommented on "Find the smallest integer in the array" rust solution

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

• ###### Tuna4242commented on "Find the smallest integer in the array" rust solution

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

• ###### arkadiy.kamnevcommented on "Fix string case" go solution

Look at the implementation of the strings.ToUpper / strings.ToLower function – there is a loop inside. So that you are using more than 1 loop in your solution.

• ###### koteykin007commented on "Convert boolean values to strings 'Yes' or 'No'." go solution

it feels like overhead but still clever

• ###### threesamcommented on "Simple multiplication" rust solution

how dare this be so beautiful

Thank you!

Ok, thanks.

• ###### Chrono79commented on "Gravity Flip (3D version)" rust solution

Please, use spoiler flag next time.

• ###### corebreakercommented on "Gravity Flip (3D version)" rust solution

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

• ###### corebreakercommented on "You only need one - Beginner" python solution

Hi @Rockkley.

Lambdas are anonymous callable objects. If you want call it later, you must use a variable, no other choice to do that. And here (in codewars) if there no name, unit test cannot check the solution.

For your information, in python, a `def` (and so, a fonction) defined like that create a variable:

``````def foobar(): pass
``````

The variable created is `foobar`, the proof, you can do that:

``````def foobar(): pass
foobar = 1234
``````

It's the aim of the mechanism under the concept of decorators.

If you prefer i can use these solutions instead of lambda, the solution will be acepted:

``````# Common accepted solution
def check(s, e): return e in s

# Another solution
def singleton(c): return c()
@singleton
class check:
def __call__(self, s, e):
return e in s
``````
• ###### westsczcommented on "You only need one - Beginner" python solution

I know that lambda is anonymous function, and there's no need to create variable for lambda, but here we need to meet the interface requirements. Requirement here is that `check` is callable.

In real world I would not create function for this one liner, that's why I'm showing solution with `lambda`.

• ###### kolichjcommented on "You only need one - Beginner" python solution

variable "check" holds the function. and ambda describes the oneliner function.

mult = lambda a,b:a*b

is the same as

def mult(a,b):
return a*b

• ###### akar-0commented on "You only need one - Beginner" python solution

What do you mean? Do you know how lambdas work? Do you know you can copy the code and make trials on your own to understand how it works? On your own computer, or just here, by clicking on `Fork`just below any solution.

• ###### Rockkleycommented on "You only need one - Beginner" python solution

Why creating a variable for lambda?

• ###### Skebardcommented on "Simple remove duplicates" go solution

clever use of mapping :)