From 15b0ba01fe0f346b86bcca7d9c150e4381cf58f9 Mon Sep 17 00:00:00 2001 From: Tanmay-312 Date: Fri, 15 Mar 2024 10:09:56 +0530 Subject: [PATCH] Added codes for 15 March --- GeeksForGeeks/March/15-3-24/GFG.java | 110 ++++++++++++++++++++++++++ GeeksForGeeks/March/15-3-24/README.md | 2 + LeetCode/March/15-3-24/README.md | 2 + LeetCode/March/15-3-24/Solution.java | 21 +++++ 4 files changed, 135 insertions(+) create mode 100644 GeeksForGeeks/March/15-3-24/GFG.java create mode 100644 GeeksForGeeks/March/15-3-24/README.md create mode 100644 LeetCode/March/15-3-24/README.md create mode 100644 LeetCode/March/15-3-24/Solution.java diff --git a/GeeksForGeeks/March/15-3-24/GFG.java b/GeeksForGeeks/March/15-3-24/GFG.java new file mode 100644 index 0000000..bc05bb0 --- /dev/null +++ b/GeeksForGeeks/March/15-3-24/GFG.java @@ -0,0 +1,110 @@ +//{ Driver Code Starts +/*package whatever //do not write package name here */ + +import java.io.*; +import java.util.*; + +class Node { + int data; + Node next; + + public Node (int data){ + this.data = data; + this.next = null; + } +} + +class GFG { + static void printList(Node node) + { + while (node != null) + { + System.out.print(node.data + " "); + node = node.next; + } + System.out.println(); + } + public static void main (String[] args) { + Scanner sc = new Scanner(System.in); + int t = sc.nextInt(); + while(t-- > 0){ + int n = sc.nextInt(); + + Node head = new Node(sc.nextInt()); + Node tail = head; + + for(int i=1; i= 0; --i) + { + ans[i] *= suffix; + suffix *= nums[i]; + } + + return ans; + } +}