LeetCode Problem | part 18 | DSA in python in telugu | Engineering Animuthyam

Поделиться
HTML-код
  • Опубликовано: 29 сен 2024
  • Free python dsa course in Telugu | Engineering Animuthyam
    Free python dsa course in Telugu
    Website link:
    vigneshreddyjulakanti.in/python
    Insta:
    Engineering Animuthyam
    python dsa
    dsa python
    python in telugu
    telugu python
    Dsa in telugu
    from scratch
    easy
    hd
    simple
    telugu engineering
    dsa
    coding
    programming
    engineering
    engineering animuthyam.
    jobs
    high paying jobs
    road maps
    Dsa in telugu
    Mern stack
    Python
    Java
    M1
    Daa
    Placements
    Btech
    IIt
    Nit
    Eamcet
    #coding #telugu #job #python #telugumemes #trendingreels #btech #college #java #javacoding #iit #pythontutorialtelugu
    #nit #jee #eamcet #dsa

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

  • @kovirisiva3567
    @kovirisiva3567 12 дней назад +6

    Bro super ga cheptunnav nak IT lo 2+ exp unna eppativaru chusina vallalo superb ra cheptunnav bro nen chala vedios chusa enta basic ga yevaru cheppaled bro..go head🎉 content kasta fast ga update cheyyi..

  • @nazeer5547
    @nazeer5547 10 дней назад +4

    bro first time nenu ni help thisukokunda solve chesina bruteforcelo feel happy bro.😍😍.

  • @b.s.n.murthy8798
    @b.s.n.murthy8798 День назад

    Arey broo.. nenu brute force radhamani alochincha but fortunately o(n) lo rayagaliga ... then ee video ki vachi chusthe nuvvu same nenu use chesina logic ey use chesav ... I'm Peeling great...

  • @vivekvardhanreddy8883
    @vivekvardhanreddy8883 2 дня назад

    anna naku ila chesthe answer vachindhi anni test cases kuda pass aindhi em kada (optimal method)
    colors=[1,1,1,6,1,1,1]
    ans=0
    n=len(colors)
    for i in range(n):
    if colors[0]!= colors[i] and i!=0:
    dif=abs(0-i)
    ans=max(ans,dif)
    if colors[i]!=colors[n-1]:
    dif=abs(i-(n-1))
    ans=max(ans,dif)
    print(ans)

  • @thanmaikrishna9825
    @thanmaikrishna9825 День назад

    So far the best bro…. Great explanation… daily serial la follow avtunna 😅

  • @4750Ahamed
    @4750Ahamed 6 дней назад

    *******Optimal way******
    l=[4,4,4,11,4,4,11,4,4,4,4,4]
    n=len(l)
    ans=0
    for i in range(0,n-1):
    if l[i]!=l[n-i-1]:
    temp=abs(i-(n-i))
    ans=max(ans,temp)
    return ans

  • @Maheshkrishna-p3b
    @Maheshkrishna-p3b 11 дней назад

    colors = [4,4,4,11,4,4,11,4,4,4,4,4]
    for i in range(len(colors)-1,0,-1):
    if colors[i] != colors[0] :
    max_dis = i - 0
    break
    for i in range(len(colors)):
    if colors[i] != colors[ len(colors)-1 ] :
    max_dis1 = len(colors)-1 - i
    break
    print(max(max_dis,max_dis1))

  • @suniljavadi1881
    @suniljavadi1881 11 дней назад

    My solution
    First Approach:O(N sqaure)
    class Solution:
    def maxDistance(self, colors: List[int]) -> int:
    r=len(colors)
    maximum=0
    res=0
    for i in range(r):
    for j in range(r):
    if(colors[i]!=colors[j]):
    res=abs(i-j)
    maximum=max(maximum,res)
    return maximum
    Optimal code: O(N)
    class Solution:
    def maxDistance(self, colors: List[int]) -> int:
    r=len(colors)
    first=colors[0]
    last=colors[-1]
    Ans=0
    Ans1=0
    Ans2=0
    maxnum=0
    for i in range(r):
    if first!=last:
    Ans=r-1
    maxnum=Ans
    break;
    if first!=colors[i]:
    Ans1=max(Ans1,abs(i-0))
    maxnum=max(Ans2,maxnum)
    if last!=colors[i]:
    Ans2=max(Ans2,abs(i-(r-1)))
    maxnum=max(Ans2,Ans1)
    return maxnum

  • @abhilashreddymitta
    @abhilashreddymitta 10 дней назад

    keep going macha

  • @jogulasharat6227
    @jogulasharat6227 11 дней назад +1

    macha super ga cheptunav bayya please bayya ee series apaiku python ki reach ravtaledu ani 🥲🥲

  • @Swajyoram
    @Swajyoram 12 дней назад +1

    Bro nenu e question ki code mundhe solve chesa website lo question open chesi . Parledhu improve ayya 0 nuche antho kontha logic wise. Optimize solution kosam vacha bro eroju

    • @engineeringanimuthyam
      @engineeringanimuthyam  12 дней назад

      Ewwwww 🔥🔥🔥🔥

    • @Swajyoram
      @Swajyoram 12 дней назад +2

      Ela.rasa bro nenu logic 😊
      n=len(colors)
      ans=0
      for i in range(n):
      for j in range(1,n):
      if colors[j]>colors[i]:
      temp=abs(i-j)
      ans=max(temp,ans)
      return ans

    • @engineeringanimuthyam
      @engineeringanimuthyam  12 дней назад

      Vere level 🔥🔥​@@Swajyoram

  • @soworld4845
    @soworld4845 12 дней назад

    Bro please give us roadmap of your way of doing conding form 1st year and how did you become good in coding

    • @engineeringanimuthyam
      @engineeringanimuthyam  12 дней назад +1

      I made a video on my journey in thid channel once chek it

    • @soworld4845
      @soworld4845 12 дней назад

      @@engineeringanimuthyam ok bro thanks

  • @lokeshreddy4148
    @lokeshreddy4148 11 дней назад +1

    Bro explain hard problems bro