Spiral Matrix - GeeksforGeeks - Day 5 of 30DaysofCode

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

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

  • @atulsingh6186
    @atulsingh6186 4 года назад

    Sir why we are returning value only when k= 0
    And what is the significance of k-= 1

    • @SaiprakashReddy
      @SaiprakashReddy  4 года назад

      we were asked to return k element from the spiral matrix list ,
      and k-=1 is equivalent of k=k-1

  • @kunalbhade8345
    @kunalbhade8345 4 года назад

    Please provide code in C++ also

    • @nupurgarg2892
      @nupurgarg2892 4 года назад

      int findK(vector &a, int n, int m, int k)
      {
      if(a.size()==0)
      return{};
      int t=0,l=0,r=m-1,b=n-1;
      int i=0;
      while(t

  • @krishnachaitanya8353
    @krishnachaitanya8353 4 года назад

    Bro, please use C++ to solve them.

    • @SaiprakashReddy
      @SaiprakashReddy  4 года назад

      Hello krishna ,
      Algorithm is the most important aspect for solving any problem , even in the interviews . Language is just the expression of the algorithm . You can implement it in any language once you understand the algorithm behind it .

    • @krishnachaitanya8353
      @krishnachaitanya8353 4 года назад

      @@SaiprakashReddy Yeah, I just advised because most people use C++ and they're pretty comfortable in it.

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

      I understood the intent krishna 🙂 , will provide the cpp code wherever necessary .

    • @dotenvwithprajjal
      @dotenvwithprajjal 4 года назад

      It's working bro