FOR THE FOLLOWING OUTPUT :
*
**
I HAVE WRITTEN THIS CODE
public static void pattern1(int n,int row,int col) {
if(row>n) {
return;
}
for(int i=1;i<=col;i++) {
System.out.print("*");
}
System.out.println();
pattern1(n,row+1,col+1);
}
IS THIS CODE CORRECT, AS THE CODE SOLUTION SHOWN IN VIDEO IS A LITTLE CONFUSING.