• Sign Up
  • Kata
  • Kumite
  • Blog
  • Forum
  • Wiki
  • Leaders
  • Log In
  • Sign Up
Name:Ermishin Michael
Clan:TimeWarp
Skills:c#, c++, java, python
Member Since:May 2016
Last Seen:Jan 2021
Profiles:
Following:19
Followers:24
Allies:14
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (436)
  • Replies
  • Authored
  • Needs Resolution
    • r4ng3l
    • resolved a question on "Hacker's job" kata

    Hi I don't remember how but I got it done, one of my favorites btw (Y)

    • VogliaDiFragola
    • commented on "Regular Expression - Check if divisible by 0b111 (7)" cpp solution

    I spent the entire afternoon drawing DFA diagrams, and finally made it, but my regex is slightly longer than this. Is this also derived from a DFA or there is some other way to resolve this problem? It's the first time I see this kind of problem, ad I'd like to learn more about this subject :)

    • ParanoidUser
    • created a suggestion for "Reversing Euclid's GCD. Parameters out of results" kata

    In my opinion, the assertion messages are quite confusing as divisor and iterations are input arguments:

    • In the case, when output A invalid the error is Divisor is not wich was expected expected:<X> but was:<Y>
    • In the case, when output B invalid the error is Number of iterations doesn't match expected:<X> but was:<Y>

    I'd expect to see the error messages addressing output parameters instead.

    Also, here is a few suggestions for the Java translation:

    1. In 75% Java solution hits the Too slow program timeout, which I don't think could be done faster then O(iterations)
    2. Sample tests would be very helpful
    3. The original GCD algorithm mentioned in the description has the 'a-b swap' step which gives a false impression that A and B order matters. Current tests don't count this. If that's expected, I'd add the note to the description. Otherwise, fix the tests to set the order.
    • ParanoidUser
    • created a suggestion for "Reversing Euclid's GCD. Parameters out of results" kata

    A little typo in the description: .. divisor of w[H]ich will be ..

    • hugocpolos
    • commented on "Remove First and Last Character" python solution

    And by anonymous, it means you can define functions without naming it, which can be really useful sometimes.

    An example of situation that anonymous functions are useful:

    You want to duplicate every digit of an array, to do that you write the following code:

    def duplicate(n):
        return 2 * n
    
    arr = [1,2,3,4]
    duplicated_arr = map(duplicate, arr) # the map function applies a given function on every element of the second argument.
    

    It works, but you may have defined a function to just calculate this duplicated array, and problably you are not going to call this function anymore.

    Instead, you could have defined the function anonymously:

    arr = [1,2,3,4]
    duplicated_arr = map(lambda x: 2*x, arr)
    
    • StephenDonovan1
    • commented on "Remove First and Last Character" bf solution

    Doesn't this run into problems if a string longer than the tape length is passed in?

    • PurpleDot
    • commented on "Century From Year" python solution

    This is clever but definitely not best practice

    • Wittybit
    • commented on "Remove First and Last Character" python solution

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

    • GiacomoSorbi
    • commented on "Remove First and Last Character" python solution

    You can only do simple operations of one line; I guess the extensive docs of the version of Python you prefer (3, I guess?) will help you much more than me :)

    • Programmer_4_Fun
    • commented on "Remove First and Last Character" python solution

    Hi Giacomo,

    Got it, thank you!

    So is:
    lambda s:
    essentially the same as
    def(s):

    Thank you again!
    Josh

    P.S. Can you elaborate what you mean here with limited and anonymous?

    • GiacomoSorbi
    • commented on "Remove First and Last Character" python solution

    It is a (limited) way to define anonymous functions in Python.

    • Programmer_4_Fun
    • commented on "Remove First and Last Character" python solution

    can you please advise me what the "lambda s" is doing here? Specifically how it's helping remove the characters

    I'm new to this.

    Thank you!
    Josh

    • ejini战神
    • resolved a suggestion on "Series of integers from 0 to n" kata

    'alr approved some time ago'

    • raffimolero
    • commented on "[BF] RGB Hexadecimal to Decimal" bf solution

    This is not how you write code

    • Haksell
    • commented on "get character from ASCII Value" javascript solution

    @B1ts Thank you so much for String.prototype.map = Array.prototype.map!
    I've always been frustrated that strings weren't iterable, didn't know it was that easy to do.

  • Loading more items...
  • © 2021 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Contact
  • powered by

Confirm

  • Cancel
  • Confirm