variable size sliding window | part 32 | DSA in java in telugu | Engineering Animuthyam

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024
  • Free Java dsa course in Telugu | Engineering Animuthyam
    Free Java dsa course in Telugu
    Website link:
    vigneshreddyjulakanti.in
    Insta:
    Engineering Animuthyam
    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
    #nit #jee #eamcet #dsa

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

  • @Chintapakdamdam-e3d
    @Chintapakdamdam-e3d 4 วันที่ผ่านมา +2

    Ardamavutundi bro bane....kani starting konchem confuse avutunna but meru explain chesaka all clear
    tq so much bro

  • @PathivrathaSiromani
    @PathivrathaSiromani 7 วันที่ผ่านมา +2

    bruh,
    Ee course motham entha duration undochuu,oka estimation cheptava pls..

  • @rchandana8919
    @rchandana8919 7 วันที่ผ่านมา +5

    PDF website lo upload cheyy macha

  • @gollagowthami5052
    @gollagowthami5052 7 วันที่ผ่านมา +1

    Hi
    Very happy to see your videos..and one more request form viewer side is,you develop one web set that show notes,links all these.please explain it.we did what you done in your video.we thought that I am good coder ,but so many candidates enable implement in our daily life as you used .

  • @thunderbuddy4795
    @thunderbuddy4795 7 วันที่ผ่านมา +1

    Hi bro please give assignments and update codes section in your website

  • @heymister3040
    @heymister3040 6 วันที่ผ่านมา +1

    Thank you so much Macha 🤝

  • @Y.NAGABHUSHANAYEDDULA
    @Y.NAGABHUSHANAYEDDULA 7 วันที่ผ่านมา +2

    Really good teaching🎉❤

  • @WORK-HARD-jm4cg
    @WORK-HARD-jm4cg 3 วันที่ผ่านมา

    without while loop ? ela undhi anna
    l=0
    temp=0
    ans=0
    for r in range(len(x)):

    if x[r]==1:
    temp=temp+1

    if temp==3 :
    if x[l]==1:
    temp=temp-1
    l=l+1


    if temp==2:
    ans=max(ans,r-l+1)
    print(ans)

  • @jansaidashaik6685
    @jansaidashaik6685 6 วันที่ผ่านมา

    class HelloWorld {
    public static void main(String[] args) {
    int ar[] = {1,1,2,1,3,1};
    int l = 0;
    int count = 0;
    int ans = 0;
    for(int r=0;r2){
    if(ar[l]==1){
    count--;
    }
    l++;
    }
    if(count==2){
    ans= Math.max(ans,(r-l+1));
    }
    }
    System.out.println(ans);
    }
    }

  • @jaswanthandhavarapu4325
    @jaswanthandhavarapu4325 7 วันที่ผ่านมา +1

    macha ni code k = 1 one test case daggara fail avutundhi emi chinna modify chesa almost kada so nenu minimum 2 ones vundali sub array lo so
    public class Main {
    public static void main(String[] args) {
    int[] arr = {0, 1, 3, 1, 1, 6, 7, 1, 0, 1};
    int k = 2; // no of max one should be in one sub Array
    int l = 0;
    int ans = 0;
    int count_ones = 0;
    for(int r = 0; r= k) {
    ans = Math.max(ans,r - l + 1);
    if(arr[l] == 1 ) {
    count_ones--;
    }
    l++;
    }
    }
    System.out.println(ans);
    }
    nenu anukuntundhi correct anukutuna wrong aithe reply cheyandi correct chesukunta

    • @engineeringanimuthyam
      @engineeringanimuthyam  7 วันที่ผ่านมา +1

      Ans ni while loop lo update cheyaku macha . Last lo update nen chesnatu so ani pass aythai ani questions same code vadutham manam

  • @LohithaYerragudi
    @LohithaYerragudi 7 วันที่ผ่านมา +3

    Edi try chesa machaa , but edi cheyadaniki more than 30 min pattindi. Chala thnxs macha, mee explanation vale nen problems try cheyagalgutuna.
    class HelloWorld {
    public static void main(String[] args) {
    int[] arr={0,1,3,10,10,6,7,1,9,1};
    int maxLen =0;
    int count=0;
    int l=0;
    int k=2;
    for(int r=0;rk){
    if(arr[l]==1){
    count--;
    }
    l++;
    }
    if(count==k){
    int len=r-l+1;
    maxLen=Math.max(len,maxLen);
    }
    }
    System.out.println(maxLen);
    }
    }

  • @vidhyasagar8903
    @vidhyasagar8903 7 วันที่ผ่านมา

    notes update cheyii macha....

  • @gollagowthami9578
    @gollagowthami9578 7 วันที่ผ่านมา

    sorry ,meru chesina browser

  • @Funnyreacts07
    @Funnyreacts07 6 วันที่ผ่านมา

    package TwoPointers;
    import java.util.*;
    public class AtmostKNumberOfOnes {
    public static void check(int[] arr, int k) {
    int n = arr.length;
    int count = 0;
    int ans = 0;
    int l = 0;
    for (int r = 0; r < n; r++) {
    if (arr[r] == 1) {
    count++;
    }
    while (count > k) {
    if (arr[l] == 1) {
    count--;
    }
    l++;
    }
    ans = Math.max(ans, r - l + 1);
    }

    System.out.println(ans);
    }
    public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] arr = new int[n];
    for (int i = 0; i < n; i++) {
    arr[i] = sc.nextInt();
    }
    int k = sc.nextInt();
    check(arr, k);
    }
    }