Pattern-13 | Solution | Java Foundation Course

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ธ.ค. 2024

ความคิดเห็น • 25

  • @biswajeet9826
    @biswajeet9826 4 หลายเดือนก่อน +1

    The pattern you've provided is known as Pascal's Triangle. Each number in the triangle is the sum of the two numbers directly above it.

  • @biswajeet9826
    @biswajeet9826 4 หลายเดือนก่อน +1

    Worth it!!

  • @shawnmosley1305
    @shawnmosley1305 2 ปีที่แล้ว +1

    we can also get the same value by storing the value and multiplying the value by 11;
    val=1;
    val=val*11;
    in the loop till nth row,]
    but the drawback of this logic is that we wont be able to print the space between the digits.
    we can do that but the size of the code will be larger and not optimized :(

    • @souravsinha5485
      @souravsinha5485 2 ปีที่แล้ว +1

      how can you print 10 with this logic even if space was not the issue?

  • @tusharjain5848
    @tusharjain5848 2 ปีที่แล้ว +3

    i found out a logic which is that the current element is sum eleemnt at position arr[i-1][j-1]+arr[i-1[j] which is true for all element but still my code is not getting accepted even after my output are correct for each input

  • @sakshiaggarwal6199
    @sakshiaggarwal6199 4 ปีที่แล้ว +2

    Thanks for Explaining sir!!

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว +2

      We always appreciate sincerity. Keep learning beta

  • @jav4725
    @jav4725 3 ปีที่แล้ว +1

    the whole playlist are hidden gem...

  • @Soccer-Infinity_7
    @Soccer-Infinity_7 3 หลายเดือนก่อน +1

    60th vedio
    29/08/2024

  • @biswajeet9826
    @biswajeet9826 4 หลายเดือนก่อน

    import java.util.Scanner;
    public class PascalsTriangle {
    public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    System.out.print("Enter the number of rows for Pascal's Triangle: ");
    int rows = scanner.nextInt();

    // Generate Pascal's Triangle
    int[][] triangle = new int[rows][];
    for (int i = 0; i < rows; i++) {
    // Initialize the current row
    triangle[i] = new int[i + 1];
    triangle[i][0] = 1; // First element is always 1
    triangle[i][i] = 1; // Last element is always 1

    // Fill in the values in between
    for (int j = 1; j < i; j++) {
    triangle[i][j] = triangle[i - 1][j - 1] + triangle[i - 1][j];
    }
    }
    // Print Pascal's Triangle
    for (int i = 0; i < rows; i++) {
    for (int j = 0; j < triangle[i].length; j++) {
    System.out.print(triangle[i][j] + " ");
    }
    System.out.println();
    }
    scanner.close();
    }
    }

  • @unknownman1
    @unknownman1 4 ปีที่แล้ว +5

    aap students ke liye Massiah se kam thodi na hain sir.

    • @Pepcoding
      @Pepcoding  4 ปีที่แล้ว +12

      Beta, jo bhi kuch hu aap sab k pyaar ki vja se he hu. The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos.
      So, keep motivating, keep learning and keep loving Pepcoding😊

  • @hemantsingh-zo3iw
    @hemantsingh-zo3iw 5 ปีที่แล้ว +1

    Sir please or videos daliye

  • @namankhurana8482
    @namankhurana8482 5 ปีที่แล้ว +3

    Hello Sir . I had a question . I am in 3rd yr .I have a basic understanding of all DS and Algos but still whenever I try to solve a problem , I am unable to do so . Mai ques ko sahi se approach hi nhi kr pata aur agr approach pta chal jaye to use code m nhi convert kr pata . Mughe har ques m same problem hoti h :( I am thinking of joining a batch at PEPCODING . Which one of your batches will be best for me ? I want to join a batch in which main focus will be on solving problems only that too relevant to interview ??

    • @anjneykumarsingh4461
      @anjneykumarsingh4461 4 ปีที่แล้ว +1

      Ap soln na dekho 2ghante tkaur code jo bhi kro khud se likho

    • @nayanmanral8433
      @nayanmanral8433 2 ปีที่แล้ว

      bhai aab aap konsi company me lag gaye ho
      please bata do motivate hone ke liye

    • @ajitpatil7214
      @ajitpatil7214 ปีที่แล้ว

      hello naman tell me how to tackled this problem and now what are you doing .

  • @ArcGaming07YT
    @ArcGaming07YT ปีที่แล้ว

    Sumit sir 🤍