Skip to main content
15 of 15
Commonmark migration

Java 131 bytes

Without using String (131 bytes)

public static void main(String[] args) {
    for(int i = 0 ,k=1; i>-1; i+=k){
        for(int c= 65, d = 1; c>64;){
            d = d>-1 & c < 65+i?1:-1;
            System.out.print((char)c+((c+=d)<65?"\n":""));
        }
        k = k>-1 & i < 25?1:-1;
    }
}

Codegolfed

for(int i=0,k=1;i>-1;k=k>-1&i<25?1:-1,i+=k)for(int c=65,d=1;c>64;d=d>-1&c<65+i?1:-1,System.out.print((char)c+((c+=d)<65?"\n":"")));

With String(173 bytes)

String a="abcdefghijklmnopqrstuvwxyz";
for(int i = 1 ,k=1; i>0; i+=k==1?1:-1){
    System.out.println(a.substring(0,i)+new StringBuilder(a).reverse().substring(27-i));
    k = k>-1 & i < 26?1:-1;
}

Codegolfed

String a="abcdefghijklmnopqrstuvwxyz";for(int i=1,k=1;i>0;k=k>-1&i<26?1:-1,System.out.println(a.substring(0,i)+new StringBuilder(a).reverse().substring(27-i)),i+=k==1?1:-1);

Thanks to manatwork and Kevin Cruijssen