Transform String || GeeksforGeeks || Problem of the Day || Must Watch

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ต.ค. 2024
  • Transform String || GeeksforGeeks || Problem of the Day || Must Watch
    Join us at telegram: telegram.me/pl...
    For all GFG courses
    get 10% Discount using Coupon code : STUDYWITHSAUMYA
    Problem (GFG) : practice.geeks...
    CODE LINK : github.com/Sau...
    #CodingInterview #GFGPractice #GeeksforGeeks #PracticeProblems #CodingQuestions #leetcode #coding #programming #coding #bfs #graphs #graph #djikstra #gfg #programming #coding #dsa #stack #queue #tree #bst #heap #maxheap #dfs #bfs #backtracking

ความคิดเห็น • 36

  • @tanishkaggarwal2846
    @tanishkaggarwal2846 3 หลายเดือนก่อน +1

    All test cases are not passed in GFG from your code

  • @rvikur6233
    @rvikur6233 ปีที่แล้ว +1

    Good Explaination !!! but i have a doubt if s1="geeksforgeeks" and s2 = "rfogeeksgeeks" , then according to your approach it gives 3 output. but in real s1 never be equal to s2 in 3 operation .
    I hope u reply me as the earlist

    • @manishmamgain8050
      @manishmamgain8050 ปีที่แล้ว

      it is possible bro , let me explain first remove o and insert in the beginning and then in 2nd turn remove f and insert in the beginning and at last remove r and then insert in the beginning so total 3 steps, i hope you understood this way

    • @prashantaarya3852
      @prashantaarya3852 ปีที่แล้ว

      actually we are not doing the actual change in string. we are just figuring out how many characters are miss placed.

    • @prajjawalkumarpatel9360
      @prajjawalkumarpatel9360 10 หลายเดือนก่อน

      similear with ABGH CDEF

  • @DoCTeRSinS
    @DoCTeRSinS 6 หลายเดือนก่อน

    Az and By has same ascii samation : >
    agr koi 0(256) space use krta hai to wo constant 0(1) use kr rha hota hai

  • @MohammadImran-bb7sj
    @MohammadImran-bb7sj ปีที่แล้ว +1

    It's failing at when String A = "anod" and String B = "mpad". Because, even if the sum of the ascii characters are same but their might be case when the character are not same. That's the reason this solution is not valid for all the test cases.

    • @shresthrakesh702
      @shresthrakesh702 ปีที่แล้ว

      use map

    • @trilochan6810
      @trilochan6810 11 หลายเดือนก่อน

      yes

    • @trilochan6810
      @trilochan6810 11 หลายเดือนก่อน

      Expected Auxiliary Space: O(1) according to GFG@@shresthrakesh702

  • @16jaybele3
    @16jaybele3 ปีที่แล้ว +1

    Your code can not pass last test case

  • @amitsinghnegi3758
    @amitsinghnegi3758 2 ปีที่แล้ว +6

    It'll fail this test case
    a = "bbc" b = "cca"
    cuz summation is equal but it's still impossible to convert a to b. Map should be used to check for anagrams.

    • @tarundatwani8427
      @tarundatwani8427 2 ปีที่แล้ว +1

      if you dont want extra space for checking anagrams
      we can simply sort it and check whether they are equal or not

    • @kxnyshk
      @kxnyshk 2 ปีที่แล้ว

      @@tarundatwani8427 Sorting too, will take an extra linear space, atleast in case of Java. Though I tried submitting my solution (with HashMaps), and interestingly gfg passed it, without any extra space warning 🤷🏾‍♀

  • @wpraagavendran4758
    @wpraagavendran4758 ปีที่แล้ว

    before posting the video run the code and verify it. because they asked minimum number of transformation

  • @MITALIPATIL-rv2hx
    @MITALIPATIL-rv2hx 7 หลายเดือนก่อน +1

    int transform (string A, string B)
    {
    if(A.size()!=B.size())
    return -1;
    int i = A.size()-1 , j= A.size()-1 , cnt = 0 ;
    map m1 ,m2 ;
    for(int i = 0 ; i=0)
    {
    if(A[i]==B[j])
    {
    i--;
    j--;
    }
    else
    {
    cnt++;
    i--;
    }
    }
    return cnt;
    }

  • @simran_ece_0214
    @simran_ece_0214 2 ปีที่แล้ว

    getting compilation error at line no. 41, 46 n 58.....

  • @Sparshchokra
    @Sparshchokra 9 หลายเดือนก่อน

    Hello Madan,
    The answer of why you are saying Array is that you are speaking too fast and it usually appears as array as it is from index 0 to N 😀

  • @181-ohamkhatri9
    @181-ohamkhatri9 ปีที่แล้ว +1

    wrong solution don't post fake or wrong videos if you don't know the correct solution

  • @makwanakirtandharmendrabha6741
    @makwanakirtandharmendrabha6741 ปีที่แล้ว +2

    anod mpad pe galat hai ye

  • @MITALIPATIL-rv2hx
    @MITALIPATIL-rv2hx 7 หลายเดือนก่อน

    Really helped a lot!!

  • @A1_04_ANIKETBANSOD
    @A1_04_ANIKETBANSOD 9 หลายเดือนก่อน

    Your Solution is Wrong , Please do not upload such wrong solution and waste our time !

  • @shantanupatil9432
    @shantanupatil9432 2 ปีที่แล้ว

    Please give solution in python also

  • @vaibhav.v6403
    @vaibhav.v6403 2 ปีที่แล้ว

    Could you please make a video on reverse string

  • @LOL-jx4cm
    @LOL-jx4cm ปีที่แล้ว

    wait a minute --------you Sound like Striver

  • @highonlife77
    @highonlife77 2 ปีที่แล้ว +1

    Good Explanation 👍

  • @AnkitSingh-wv8xd
    @AnkitSingh-wv8xd 2 ปีที่แล้ว

    Nice Explaination . Thank you Saumya.

  • @ashishsoni8082
    @ashishsoni8082 2 หลายเดือนก่อน

    this stupid video took a lot of my time

  • @hrithikkumar9648
    @hrithikkumar9648 2 ปีที่แล้ว

    koi nhi thodi galti maaf h

  • @theperfectcoders1982
    @theperfectcoders1982 ปีที่แล้ว +2

    Fails when A = "anod" , B = "mpad",

    • @anukulsahu
      @anukulsahu ปีที่แล้ว

      only this test case fails