Glad to hear that and If you like the content could you post something on LinkedIn about us? This will help us in reaching out to more people and help a lot of other students as well Something like this Sumeet Malik from Pepcoding is making all his content freely available to the community You can check it out here - www.pepcoding.com/resources / Also, this is the youtube channel - th-cam.com/users/Pepcodingplaylists?view_as=subscriber
I came up with following solution , though it works in eclipse but in pepcoding editor when submitted is says wrong answer , can you just validate this ? import java.util.*; public class Main{ public static void main(String[] args) { Scanner scn = new Scanner(System.in); // write ur code here
int n = scn.nextInt(); int size = (n * 2) - 1; int temp = 1; int space = size - 2; int star = 1; int star2 = 1; for (int i = 1; i
better approach import java.util.*; class pattern16 { public static void main(String[] args) { System.out.println(" Enter a number "); Scanner scn = new Scanner(System.in); int num = scn.nextInt(); int n = 1; int sp = num + 1; for (int i = 1; i
my approch of doing it public class PaternQ16 { public static void main(String[] args) { int n = 4; int m = 2*n - 3; for (int i = 0; i < n; i++) { int x = 0; for (int j = 1; j < 2 * (n); j++) { if (j
ho gya solved: import java.util.*; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); int sp = 2 * n - 3; for (int i = 0; i < n; i++) { int temp = 0; int stp = sp; for (int j = 0; j < 2 * n - 1; j++) { if (j 0) { System.out.print("\t"); stp--; } else { if (temp == n) { temp--; } System.out.print(temp-- + "\t"); } } sp -= 2; System.out.println(); } } }
thank u sir its ur free resource course is really helping
Glad to hear that and If you like the content could you post something on LinkedIn about us? This will help us in reaching out to more people and help a lot of other students as well
Something like this
Sumeet Malik from Pepcoding is making all his content freely available to the community
You can check it out here - www.pepcoding.com/resources
/
Also, this is the youtube channel - th-cam.com/users/Pepcodingplaylists?view_as=subscriber
sir you teach very well thankyou so much sir for this playlist
Thanks for the wonderful content,
You are really a gem Sir!
I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem.
How is it 2n-3
Thanks sir❤
I came up with following solution , though it works in eclipse but in pepcoding editor when submitted is says wrong answer , can you just validate this ?
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
// write ur code here
int n = scn.nextInt();
int size = (n * 2) - 1;
int temp = 1;
int space = size - 2;
int star = 1;
int star2 = 1;
for (int i = 1; i
Thanks a lot sir !!
All thanks to you people🙏🏼
With the love and respect which Pepcoding is getting from you people, we are able to make all this content.
I printed the second part in reverse...
Scanner sc = new Scanner(System.in);
int size = sc.nextInt();
int sp = 2*size -3;
for(int i = 1; i
better approach
import java.util.*;
class pattern16 {
public static void main(String[] args) {
System.out.println(" Enter a number ");
Scanner scn = new Scanner(System.in);
int num = scn.nextInt();
int n = 1;
int sp = num + 1;
for (int i = 1; i
my approch of doing it
public class PaternQ16 {
public static void main(String[] args) {
int n = 4;
int m = 2*n - 3;
for (int i = 0; i < n; i++) {
int x = 0;
for (int j = 1; j < 2 * (n); j++) {
if (j
es ques mei thodi dikkat aayi approach me
ho gya solved:
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int sp = 2 * n - 3;
for (int i = 0; i < n; i++) {
int temp = 0;
int stp = sp;
for (int j = 0; j < 2 * n - 1; j++) {
if (j 0) {
System.out.print("\t");
stp--;
} else {
if (temp == n) {
temp--;
}
System.out.print(temp-- + "\t");
}
}
sp -= 2;
System.out.println();
}
}
}