Found this problem somewhere online and wanted to try this out with my beginner skills. I was able to solve this problem but how can I make my code better?We need to print a pattern like this (each line has one more character in length):E  my  iyt  hTri  bbiann  iHere is the solution I have written, and I want help in the following areas:What am I doing wrong and how can I make it better?How can I learn to write better code and logic?public class nameIncrementing {    public static void main(String[] args) {                char[] text={'E','m','y','i','y','t','h','T','r','i','b','b','i','a','n','n','i'};                int count =0;                int length = text.length;                int icnt=0;                for(int i=0;i<length;i++){                    if(i==0)                        System.out.println(text[0]);                    else{                        if(count+1>=length)                        {break;}                        else{                            for(int j=count+1;j<i+2+count;j++){                                icnt++;                                if(j>=length)                                    break;                                else                                    System.out.print(text[j]);                                                          }                    count = count+icnt;                    icnt=0;                    }                    System.out.println();}                }    }}
Pattern printing with Name
java