Let's Code Codewars - Codewars Challenges #1

Поділитися
Вставка
  • Опубліковано 3 лис 2024

КОМЕНТАРІ • 104

  • @NeuralNine
    @NeuralNine  3 роки тому +54

    In the beginning the code font size is a bit too small, but I increase it throughout the video, so don't worry! ^^

    • @IzUrBoiKK
      @IzUrBoiKK 3 роки тому

      Np

    • @AndersJackson
      @AndersJackson 3 роки тому

      You should try Ocaml/F#. That is a fun language, functional, where it also have Currying, that is partial application of arguments, so if you add one argument to few, you get a function with one argument.

  • @gi0rg0s17
    @gi0rg0s17 3 роки тому +52

    If this becomes a series it will be very interesting. I am into competitive programming and it will be really important. Thank you for the amazing content!

    • @NeuralNine
      @NeuralNine  3 роки тому +7

      it all depends on how many people watch it and for how long ^^

    • @imon2456
      @imon2456 3 роки тому +2

      @@NeuralNine maybe just make it shorter and i am sure people will watch it

  • @haydeng.4116
    @haydeng.4116 Рік тому +4

    Honestly man this is super helpful to see someone just work through some challenges.

  • @zettkusanagi6322
    @zettkusanagi6322 11 місяців тому

    I love how you show us your thinking process. I emphasize just finding a solution. After that, check to see other options. There are people who solve these with in ingenious ways.

  • @abo000Saad
    @abo000Saad 3 роки тому +21

    Very interesting video, I hope we can see more like this in the future.

  • @charan2446
    @charan2446 3 роки тому +10

    Tip: If you are doing anything like code competition, at first just go for inefficient code if that passes the test then go back to code and modify your code efficiently. It will make it easier.
    It may take some time but it will help.
    I'm not a ultra pro programmer anything like that 😉 I'm still learning. What I'm saying is came from my experience. Hope it helps.
    Sorry for my English

  • @bananainapajama1573
    @bananainapajama1573 3 роки тому +6

    Wish you do more like that, love your content ❤.

  • @awaterplease7885
    @awaterplease7885 3 роки тому +9

    Interesting and entertaining! Hope you'll make more.

  • @PRAS223
    @PRAS223 3 роки тому +6

    39:25 actually there is string method called strip(), it will remove all whitespaces, \t,
    in the beginning and end of a string.

  • @WeebDweebTCG
    @WeebDweebTCG 3 роки тому +3

    Dude, you have some excellent proficiency and problem solving skills! Can tell because you can do a lot of this on the fly without a systematic breakdown of the problems in long-hand form.
    If you are new to programming, keep in mind that what he is doing is understanding the problem, thinking of the solution, and implementing it in syntax...in this case Python. I think the most difficult part when you're new is being able to translate a potential solution into code.
    Understand your problem. Think about the examples. Decide what data structure you're going to use. Write out your algorithm, and then code! You should spend most of your time solving the problem and understanding it, and then translating that solution to code.
    He knows the theoretical/logic portions of coding very well, and is proficient with the language, so NeuralNine can arrive at these solutions in a systematic manner.
    Most of you will probably have to write everything out in pseudo code and then translate it to actual code.
    And people shouldn't lose respect over your solution. lol Especially since that's a 5kyu and you're putting all of this out to the public. Great video good sir. Subscribed.

  • @navidmehdi6
    @navidmehdi6 Рік тому

    This codewars thing looks like so much fun qnd the perfect way to practice. Im new to try and get into programming and this help me keep all the new concepts in my brain.

  • @vardhanr8177
    @vardhanr8177 3 роки тому +3

    thank you soooo much for this AMAZING video!!! this is such a coooool website that i did not know about before... it looks realllly fun... and would help a lottt with learning (for example: i didn't know about that ::-1 reverses the string thing before)!

  • @thomasgoodwin2648
    @thomasgoodwin2648 3 роки тому

    Raw coding. Pure and unrefined. This so often what is precisely not taught in schools. ❤️❤️❤️
    One question it raises:
    "What is an appropriate amount of time to spend on 'polishing the brass' vs 'close enough for gvmnt work' ?"
    Perhaps we need some sort of Big O for coding complexity as well as just runtime or resource management.

  • @muhammadahsan8251
    @muhammadahsan8251 3 роки тому +4

    I come up with your channel few time ago. Really loved your content. These uncut videos are really amazing but I want to add something. Instead of going with all problems just select one problem that you think is quite challenging and only make video on that it will also save time

  • @sw-code6027
    @sw-code6027 3 роки тому +5

    Amazing we need more content like this ❤

  • @unrealcarol
    @unrealcarol 7 місяців тому

    Love this video, pls keep doing, hi from Brazil! I just disagree with this extreme need for smoothness, for example in the third challenge I believe, the split out of the list comprehension is much more readable, I liked your solution more then the one with the split inside the list comprehension. Most of the times it’s good to be objective but sometimes just putting everything inside the list comprehension doesn’t help with the readability. But incredibly anyway, keep doing it pls!

  • @pythonbotofitsskt9286
    @pythonbotofitsskt9286 2 роки тому +2

    Very entertaining content

    • @TwilightSun32
      @TwilightSun32 Рік тому

      btw there is a 'fork' button under solution in codewars where one could check how solution works and compare performance as well

  • @kiat4797
    @kiat4797 3 роки тому

    for the last kata , the abstract solution is pretty simple and comprehensive , the new_plan list is used as a stack. A same problem that is a calssical problem in data structures : the parenthesis checker .Anyways i'm really enjoying with you this series, Road to 1kyu if possible. keep up the great work .

  • @simon3431
    @simon3431 3 роки тому +4

    your channel is incredible dude.. please keep uploading videos 😁

  • @osamaalhemiary9343
    @osamaalhemiary9343 Рік тому

    Great job, man!
    This is a real creditable effort for which you are highly appreciated. If you don't mind, please keep this up casting some more videos of this kind.

  • @TomBenRu
    @TomBenRu 3 роки тому +1

    I like it very much, to follow your thuoghts step by step, Good idea, to make such a format.

  • @TalsonHacks
    @TalsonHacks 3 роки тому

    This series is really interesting, and making it spontaneous made it even better.

  • @NielsPerfors
    @NielsPerfors 3 роки тому +1

    The count problem:
    1. Create a dict comprehension with key = letter, value = count of letter
    2. Return the Len of a list comprehension with value of key > 1

  • @hosnymubark6528
    @hosnymubark6528 3 роки тому +5

    5:10
    You could actually do string.replace().replace().replace()
    All in one line.

  • @south828
    @south828 6 місяців тому

    your 5th solution asks if we've encountered the letter before ( if letter.lower() not in occurred: )
    occurred is a list and it's O(n) (can be very slow for large lists)
    you check it for every letter so overall time complexity is O(n^2)
    use sets
    or just use collections.Counter
    fun to watch you struggle anyway, we all can relate 😶‍🌫

  • @irshadtarsoo7734
    @irshadtarsoo7734 3 роки тому +5

    Hope you do more episodes♥️💯

  • @calmvolatility2787
    @calmvolatility2787 2 роки тому +1

    looks like translate works in python 2 not 3 so that's why the disconnect between codwars and that w3schools page. return s.translate(s.maketrans(dict.fromkeys("aeiouAEIOU")))

  • @dead3541
    @dead3541 3 роки тому +4

    Love this..

  • @MattDvc
    @MattDvc 3 роки тому +1

    Good way to learn tricks you may need in the future. more please.

  • @nelsonberm3910
    @nelsonberm3910 Рік тому

    This seems so interesting thank you for sharing!

  • @SIAMEInekeidijdnen
    @SIAMEInekeidijdnen 3 роки тому

    this is amazing man! keep it up bro

  • @almaring2839
    @almaring2839 3 роки тому +3

    For counting duplicates, why not use a map (or dictionary in Python) to store the number of occurrences of each letter (in a case-insensitive way), then traverse the map's key value pairs and add 1 to your result each time the value is greater than 1?

    • @NeuralNine
      @NeuralNine  3 роки тому

      that seems to me like a worse runtime complexity. You would have to iterate through the whole string to count first (linear runtime) and then through all the key-value pairs. Besides that you have to use more memory to store all values. But sure it would also work.

    • @almaring2839
      @almaring2839 3 роки тому +4

      @@NeuralNine I believe that your complexity is O(n*m) (n to iterate through the text and m each time you use the *in* operator within the loop), while my suggested solution is O(n+m) (n to iterate through the text with O(1) insertion time for the map, then m to iterate through the whole map).

    • @the-ghost-in-the-machine1108
      @the-ghost-in-the-machine1108 Рік тому

      @@almaring2839 ur right bro.Furthermore, if it was asked to return the count for each duplicated letter in the questions , your solution would be a lot meaningful. Bytheway, i also solved the problem like you.

  • @samoylov1973
    @samoylov1973 Рік тому

    If shortest way to the destination matters in the last challenge, wrote another solution:
    lst = ['n', 's', 's', 'e', 'w', 'n', 'w']
    def directions(lst):
    res_y = lst.count('n') - lst.count('s')
    res_x = lst.count('e') - lst.count('w')
    dir_y = 'n' * res_y if res_y > 0 else 's' * abs(res_y)
    dir_x = 'e' * res_x if res_x > 0 else 'w' * abs(res_x)
    return [*dir_x] + [*dir_y]

  • @Bryzey7
    @Bryzey7 3 роки тому +1

    Would like to see more of this👍

  • @jacekwopiuk1799
    @jacekwopiuk1799 2 роки тому

    Yoy are great! I like, how you explain things

  • @Radical9535
    @Radical9535 Рік тому

    cool that website looks fun! gotta check it out!

  • @mimurajam1501
    @mimurajam1501 3 роки тому

    I liked that format

  • @joshuamarcano350
    @joshuamarcano350 2 роки тому

    The amount of one line bandits on codewars is astronomical lol

  • @coolsav0074
    @coolsav0074 3 роки тому

    ❤️Hey I am following your go tutorial course. I know as a UA-camr you need views and (as per I know) go course are not getting that much view. But there are people like me who really want to learn go and need some detailed course. So if possible please at least make one video per week but don't just discontinue it. Really love your video and just fan of your video.

  • @lucario4399
    @lucario4399 3 роки тому +3

    Woooooooowww

  • @giftchukwuemeka8324
    @giftchukwuemeka8324 Рік тому

    i love this, more of this

  • @AaPerm
    @AaPerm 2 роки тому

    Enjoy this episode quite a lot, hope it could become a series.

  • @jkf114
    @jkf114 3 роки тому

    True legends writing one line lambdas for every kata

  • @RohitKumar-dv7bw
    @RohitKumar-dv7bw 3 роки тому

    I liked so much. I hope, I will get such interesting videos in future.

  • @DreadNought-n2b
    @DreadNought-n2b 3 роки тому +1

    It's sad how people suffer due to lack of knowledge (most times I'm thinking of how to construct a for loop and he's already using an inbuilt function to make it easier 🤯🤯))

    • @sitter2207
      @sitter2207 3 роки тому

      That's why codewars is amazing. I complete it with my trash solution, then check other people's 500iq solutions and learn from them. It's actually amazing to see those clever answers from other people. Or the trolls who hardcode 1000 lines lol.

  • @watcharaponhongthong7869
    @watcharaponhongthong7869 3 роки тому

    Very useful! Keep do it.

  • @mohsenhaddadi1117
    @mohsenhaddadi1117 3 роки тому

    39:35
    Just don't pass any argument to split() function
    return arr.split() instead of arr.split(" ")
    and this will remove all 1 or 2 or 3 white spaces

  • @aourfiidir4163
    @aourfiidir4163 7 місяців тому

    if u tried using c that gonna be a mindblowing programme

  • @arissk_
    @arissk_ 3 роки тому

    I think it would be awesome if you started some video series on python katas at codewars. The are thousands of codewars addicts!

  • @JADE2238
    @JADE2238 3 роки тому

    Bro we want more because it will increase our coding thinking skills so please make more on this topic

  • @ivanhelsing7378
    @ivanhelsing7378 3 роки тому +1

    That`s cool man!

  • @abhishekraibagi8239
    @abhishekraibagi8239 Рік тому

    🎯 Key Takeaways for quick navigation:
    01:40 🤖 The video is about solving Codewars challenges, starting from easy ones and progressing in difficulty.
    02:07 🛡️ The first challenge tackled is removing exclamation marks from a given string, a simple task.
    03:01 💼 A challenge is introduced to check if a string ends with a specific substring.
    04:41 🤖 Another challenge involves removing vowels from a string.
    10:16 💼 A more complex challenge is presented, requiring reversing words in a string with five or more letters.
    16:06 🤖 The final challenge involves counting distinct case-insensitive alphanumeric characters that occur more than once in a given string. Multiple solutions are explored.
    27:42 🗺️ This coding challenge involves optimizing directions by removing needless opposites (e.g., north-south, east-west) to save energy.
    29:03 🔄 The approach to solving the challenge is recursive, checking for opposite directions and removing them until no changes are needed.
    31:23 🧵 String manipulation is used to handle the directions, with joins, replacements, and splits being key operations.
    38:06 🧹 Additional steps are taken to clean up the resulting string, including removing duplicate spaces and handling edge cases.
    43:45 🤓 Alternative solutions involve more elegant approaches, such as using dictionaries and recursion to optimize the directions efficiently.
    Made with HARPA AI

  • @codingboy2254
    @codingboy2254 3 роки тому +1

    Intro !

  • @KR_Technical-hj3bf
    @KR_Technical-hj3bf 11 місяців тому

    In my college there is code war event . May i hope this will be helpful

  • @omari6108
    @omari6108 2 роки тому

    Challenge #4 is still a bit confusing. I understand that you're using list comprehension, but I haven't seen it used the way you're using it. Typically the result variable comes first, then the for loop in which that variable will be used + additional expressions. In the way you're using it "word" is undefined in the beginning, yet you're operating on it (it yet doesn't have a value to reverse, or length to determine), then defining it later?
    I struggled writing it out the long way and hit a roadblock with using the four loop. As the iterator iterates over the list (the string having been split), the values are returned on a new line. I didn't know how to overcome that. Does the list comprehension being in a list prevent that?
    I understand what needs to be done, but not understanding how your solution arrived at the answer.

  • @irshadtarsoo7734
    @irshadtarsoo7734 3 роки тому +1

    👍💯

  • @s.aravindh6227
    @s.aravindh6227 3 роки тому +2

    Nice video bro 👍👍👍

  • @alexott50
    @alexott50 3 роки тому

    Let’s we more of this

  • @Beny123
    @Beny123 3 роки тому

    Good job!

  • @ramsy-sploit22
    @ramsy-sploit22 3 роки тому

    21:35 you can use dict soo you can add the key wich is the letter and his value is the number of the times have being theis letter appird in the text with that way you can use update method to update the number of the time only ???

  • @mert-fh2vx
    @mert-fh2vx 3 роки тому

    thats a good content

  • @guilherme5094
    @guilherme5094 3 роки тому

    Very good!

  • @atharAkru
    @atharAkru 2 роки тому

    bro! I think you are making this video for advance learner, as you are using very hard syntax without explaining, so how do i get? 15:19 thank god i saw the other method there.

  • @hungariannerd8445
    @hungariannerd8445 Рік тому

    I'm still messed up about that Translate function - it doesnt work for me either!

  • @therostgame5024
    @therostgame5024 3 роки тому

    Can you made a series like this but more easyest for beginners?

  • @milanrbx5592
    @milanrbx5592 3 роки тому

    Does playing code wars make you better at python?

  • @atlantic_love
    @atlantic_love 3 місяці тому +1

    LOL at trying to capitalize off your guitars by placing them in the background. So many gullible people out there who will trust anyone who appears to display multiple talents, lol.

  • @nordgaren2358
    @nordgaren2358 3 роки тому

    On counting duplicates, couldn't you have done something like the set count from the regular string count and return that? If it's even it returns 0, if set is less, then it returns how many duplicates there were.

    • @nordgaren2358
      @nordgaren2358 3 роки тому

      Actually, now that I read the test requirements, it's not asking how many total duplicates, just how many letters have duplicates.

    • @nordgaren2358
      @nordgaren2358 3 роки тому

      Here was the solution I came up with, though
      Spoilers
      ------
      from collections import Counter
      def duplicate_count(text):
      return len([k for k,v in Counter(text.lower()).items() if v>1])

  • @bini420
    @bini420 2 роки тому

    nice

  • @lornemalvoo
    @lornemalvoo 3 роки тому

    MORE!!!

  • @themihanoid5020
    @themihanoid5020 2 роки тому

    Isn't the whole point of coding challenges to learn how algorithms like "replace" or "endswith", etc. work under the hood and try to replicate that, not just use them?

  • @milindoox9453
    @milindoox9453 3 роки тому +1

    Bro plz video for PyQt5 with Qt designer

  • @brunomiguel2084
    @brunomiguel2084 3 роки тому

    do one in go !!

  • @giannismakarounas5966
    @giannismakarounas5966 3 роки тому

    Make more videos like that

  • @rustybolt_
    @rustybolt_ Рік тому

    So what does the translate function do?

  • @Imdazedandconfuzed
    @Imdazedandconfuzed 2 роки тому

    # translate() one argument == a map
    dictionary_map = {‘H’: ’’, ‘J’: ’’} # one argument
    s = ‘Hello World! JJJJ HHHH’
    s = s.translate(dictionary_map)

  • @mickyfazler
    @mickyfazler 3 роки тому

    Please make video on complete zoom clone in python... Please... Thank you Sir.🧡

  • @babiarzu95
    @babiarzu95 2 роки тому

    Do you think codewars challenges are good way to learn?

  • @natasdabsi1138
    @natasdabsi1138 4 місяці тому

    Please do more

  • @andrewcarranza1562
    @andrewcarranza1562 2 роки тому

    your laying waste to the battlefield

  • @laurentk2033
    @laurentk2033 3 роки тому

    I've done a lot of 6-7 kyu in C and omg its so fucking ez in python lul

  • @insert9124
    @insert9124 3 роки тому +1

    U know a video did good when it got 1/10 likes

    • @NeuralNine
      @NeuralNine  3 роки тому

      I am really happy that you like it ^^

  • @IzUrBoiKK
    @IzUrBoiKK 3 роки тому

    Can we take part?

  • @opcon3155
    @opcon3155 Рік тому

    For vowel removal, my way would be :
    “”.join([char for char in string if char not in list_of_vowels])

  • @lowlight1063
    @lowlight1063 9 місяців тому

    duplicate_count oneliner:
    return len(text) - len("".join(list(set([l for l in text]))))