Jumping on the Clouds Problem [HackerRank] | Interview | Problem Solving

Поделиться
HTML-код
  • Опубликовано: 1 фев 2025

Комментарии • 27

  • @madhankumarb08
    @madhankumarb08 Год назад +1

    Thank you so much sir ❤❤❤❤❤❤❤❤❤❤

    • @codingcart
      @codingcart  Год назад

      Glad it helped😊. Please do share with your friends too😊

  • @husler7424
    @husler7424 2 года назад +2

    The most underrated solution. I searched here and there but didn't find such explanation. Unmatchable. Thanks @coding cart.

    • @codingcart
      @codingcart  2 года назад +1

      Glad you liked it 😊.
      Do share with your friends too 🙂

  • @jaabryan
    @jaabryan 4 года назад +7

    I learned from this exercise the order of the if conditions matters. Placing c[i+2] first results in out of range since it is evaluated before n+2

  • @rayhan8701
    @rayhan8701 5 лет назад +3

    Thank you bro...

  • @Ravikumar-gj6qw
    @Ravikumar-gj6qw 21 день назад

    Do in Java

  • @blackraven6049
    @blackraven6049 3 года назад +1

    Thanks dude. I have solved problems way harder than this in the past but haven't done many algorithmic problems as of late and was getting frustrated why some cases weren't passing when the solution was so obvious (if you are somewhat experienced). My issue was that I was not checking if i + 2 < len(c) before checking if c[i + 2] == 0. Seems so obvious now but was huge pain when I wasn't getting it. Anyway thanks for the explanation.

    • @codingcart
      @codingcart  3 года назад

      Always try to check boundaries cases😊

  • @Darpangaire
    @Darpangaire Год назад

    sir what is your networth and which company are you currently working??

  • @State_exam_preparation
    @State_exam_preparation 4 года назад +3

    Waw👌

  • @sumanthchowdary9699
    @sumanthchowdary9699 4 года назад +1

    why while i < len(c) -1:? y don't while i < len(c) :?

    • @codingcart
      @codingcart  4 года назад +2

      Just give a try from your end...you will get it :)

    • @AdityaSharma-fd9px
      @AdityaSharma-fd9px 4 года назад +2

      It will give you out of range error

    • @rudeadyet1992
      @rudeadyet1992 4 года назад +4

      len_of_clouds = 7
      which means last index = 6
      so when i=6, (i+2) it would be (6+2 = 8) and 8 is out of range. So in case of i < len(c), "i" would reach to 6, so to avoid that you should minus 1 to len(c), which make loop iterate till i = 5. hope that makes sense! 😅

    • @sumanthchowdary9699
      @sumanthchowdary9699 4 года назад +2

      @@rudeadyet1992 thanks for ur explanation. I was noob at that time😂

    • @rudeadyet1992
      @rudeadyet1992 4 года назад +1

      @@sumanthchowdary9699 no worries :)

  • @ashoksa1484
    @ashoksa1484 3 года назад +2

    thank you bro,
    i hv a suggestion for your channel to grow
    i saw a channel named JAVAID he is getting lots of views in same questions which you have done in your channel
    what he is doing is , in every discussion section of every question he had given his link of particular video and had written few words about that question thts all.. I suggest u also do the same and look how your views will increase
    coz u deserve more views
    thank u
    p.s- channel name is JAVAAID-Coding Interview Preparation

    • @codingcart
      @codingcart  3 года назад

      Okay, Thank you for your suggestions. We will keep in mind. Thanks again for you support

    • @ashoksa1484
      @ashoksa1484 3 года назад

      @@codingcart always welcome bro

  • @sivashankaramaravelpandian2102
    @sivashankaramaravelpandian2102 3 года назад

    c = [0, 1, 1, 0, 0, 0, 1, 0, 0] or c = [0, 1, 1, 1, 0, 0, 0, 1, 0, 0]

  • @temitopeagoro4603
    @temitopeagoro4603 4 года назад +1

    Why wouldn't a counter with a for loop not work here?

  • @sivashankaramaravelpandian2102
    @sivashankaramaravelpandian2102 3 года назад

    did anyone
    try continuous 2 thunderhead in this code.

  • @abelorrego3243
    @abelorrego3243 3 года назад +1

    Thank you for the video! A final question. I don't get why to put "while i