Arrays: Left Rotation

  • + 0 comments

    JAVA

    ** List s= new ArrayList<>();

        for (int i = d ;  ;  ) {
            s.add(a.get(i));
            i++;
            if (i==d) {break;}
            else if (i==a.size()) {i=0;}
    
    
    
        }
    return s;**