From 540febf2f1076dcd8c650c76bc9de1fb2f84eb1e Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:27:38 +0530 Subject: [PATCH 01/32] Update p3.py to see collab --- py/p3.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/py/p3.py b/py/p3.py index c83d5ad..200a758 100644 --- a/py/p3.py +++ b/py/p3.py @@ -9,5 +9,6 @@ def delete_starting_evens(list): break return list -list = [2, 8, 10, 11] +list = [2, 8, 10, 11 + #changes visible print(delete_starting_evens(list)) From 74ac8cde5c590ca45c4e1672acc4a61863889079 Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:04:14 -0400 Subject: [PATCH 02/32] Update p11.c --- c/p11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p11.c b/c/p11.c index d6ef183..b67fd08 100644 --- a/c/p11.c +++ b/c/p11.c @@ -13,7 +13,7 @@ int isSameTree(struct TreeNode* p, struct TreeNode* q){ return 1; } if(p->val == q->val){ - return isSameTree(p->left, q->left) || isSameTree(p->right, q->right); + return isSameTree(p->left, q->left) && isSameTree(p->right, q->right); } return 0; } From a92757922fa9866fc139de563ccdd303b4c2fdbd Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:04:47 -0400 Subject: [PATCH 03/32] Update p13.c --- c/p13.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/p13.c b/c/p13.c index 753cad1..73cff9b 100644 --- a/c/p13.c +++ b/c/p13.c @@ -3,7 +3,7 @@ #include #include -int i = 0; +//int i = 0; int main(){ int i = i; @@ -17,7 +17,7 @@ int main(){ printf("%d ", a[i]); } printf("\n"); - for(i;i Date: Sat, 16 Mar 2024 02:05:18 -0400 Subject: [PATCH 04/32] Update p14.c --- c/p14.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p14.c b/c/p14.c index fdd4b97..1a78b65 100644 --- a/c/p14.c +++ b/c/p14.c @@ -5,7 +5,7 @@ #include int romanToInt(char * s){ - int *a = (int *)malloc(strlen(s) * sizeof(int)); + int *a = (int *)malloc((strlen(s)+1) * sizeof(int)); for(int i=0;i Date: Sat, 16 Mar 2024 02:05:50 -0400 Subject: [PATCH 05/32] Update p15.cpp --- c/p15.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/c/p15.cpp b/c/p15.cpp index e1d9f33..7ad200b 100644 --- a/c/p15.cpp +++ b/c/p15.cpp @@ -11,11 +11,11 @@ void Upper(char *word) { int Check(char *S) { for(int k = 0, v = 0; S[k]; k++) switch(S[k]) { - case A: - case E: - case I: - case O: - case U: v++; + case 'A': + case 'E': + case 'I': + case 'O': + case 'U': v++; } return v; } From 98b39c6240f5bad6d91e7106153ec9c2472e1aca Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:06:11 -0400 Subject: [PATCH 06/32] Update p2.cpp --- c/p2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p2.cpp b/c/p2.cpp index c1a5fa7..b803393 100644 --- a/c/p2.cpp +++ b/c/p2.cpp @@ -22,7 +22,7 @@ int A::func(){ return variable; } -int anotherFunc(A a){ +int anotherFunc(A &a){ a.variable += 3; return a.variable; } From 654693636e09ef36ab6c9058da40f36f4144b344 Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:06:46 -0400 Subject: [PATCH 07/32] Update p3.cpp --- c/p3.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p3.cpp b/c/p3.cpp index 212f550..e99b107 100644 --- a/c/p3.cpp +++ b/c/p3.cpp @@ -14,7 +14,7 @@ vector productExceptSelf(vector& nums) { int r = 1; for(int i=nums.size()-1;i>=0;i--){ ans[i] *= r; - r = nums[i]; + r = r*nums[i]; } return ans; } From 4b963bcc30e305e99a348cedd8589a14b27f4f83 Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:07:35 -0400 Subject: [PATCH 08/32] Update p4.cpp --- c/p4.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/p4.cpp b/c/p4.cpp index 1e83511..d7ac44f 100644 --- a/c/p4.cpp +++ b/c/p4.cpp @@ -10,10 +10,10 @@ string caesar(string s, int k, string direction){ string ans = ""; for(int i=0;i Date: Sat, 16 Mar 2024 02:08:05 -0400 Subject: [PATCH 09/32] Update p5.c --- c/p5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p5.c b/c/p5.c index 09475d3..977cf80 100644 --- a/c/p5.c +++ b/c/p5.c @@ -6,6 +6,6 @@ void main(){ int a=10; int *ptr = &a; - *ptr++; + (*ptr)++; printf("%d", *ptr); } From a020afbb85b88303ffc485454d447af4e06f6b12 Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:08:24 -0400 Subject: [PATCH 10/32] Update p6.c --- c/p6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p6.c b/c/p6.c index 2e46837..b7d4e45 100644 --- a/c/p6.c +++ b/c/p6.c @@ -3,7 +3,7 @@ #include int *fun() { - int x = 5; + static int x = 5; return &x; } int main() From 1483f4d8d6a1fa66d4392c45a35314a6f470b2c2 Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:08:48 -0400 Subject: [PATCH 11/32] Update p7.cpp --- c/p7.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p7.cpp b/c/p7.cpp index c5ed765..e68616d 100644 --- a/c/p7.cpp +++ b/c/p7.cpp @@ -5,7 +5,7 @@ using namespace std; int func(string s){ - int counter=-1; + int counter=0; while(counter Date: Sat, 16 Mar 2024 02:11:18 -0400 Subject: [PATCH 12/32] Update p8.c --- c/p8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p8.c b/c/p8.c index 5379851..943d308 100644 --- a/c/p8.c +++ b/c/p8.c @@ -16,6 +16,6 @@ int main() { float x[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; size_t N = 10; - printf("%.3g\n", computeAverage(x, &N)); + printf("%.3f\n", computeAverage(x, &N)); return 0; } From 7cd4c1e01a501d73d3265fdcb2d0f20febc04018 Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:42:46 +0530 Subject: [PATCH 13/32] Update p1.py --- py/p1.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/p1.py b/py/p1.py index b648ec0..0000282 100644 --- a/py/p1.py +++ b/py/p1.py @@ -7,6 +7,8 @@ def asterisk_tree(height,level): if level > height: return + for i in range(1,height-level+1): #for loop for adding spaces to centre the pattern + print(" ",end="") for j in range(2*level-1): print("*", end="") print() From 534e1f9f249269f5a2554147a5edfa44050fa1c1 Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:43:17 +0530 Subject: [PATCH 14/32] Update p2.py --- py/p2.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/py/p2.py b/py/p2.py index 237c9b9..d91163d 100644 --- a/py/p2.py +++ b/py/p2.py @@ -2,8 +2,10 @@ # input- 1 -> output- [1], input- 2 -> output- [2] def add_item(item, items=[]): - items.append(item) - return items + if len(items)!=0: + items.pop(0) + items.append(item) + return items print(add_item(1)) print(add_item(2)) From 7a429a84aa695712c9abcc903213b647ffec4329 Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:44:16 +0530 Subject: [PATCH 15/32] Update p3.py --- py/p3.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/py/p3.py b/py/p3.py index 200a758..9a6e852 100644 --- a/py/p3.py +++ b/py/p3.py @@ -2,11 +2,9 @@ #eg: [2, 4, 6, 17, 10] -> [17, 10] def delete_starting_evens(list): - for item in list: - if list[0] % 2 == 0: - list.pop(0) - else: - break + for item in range(len(list),-1,-1): # changing to range + if list[item]%2==0: # eheck element at index is even + list.pop(item) return list list = [2, 8, 10, 11 From f51b4b6fb067471c84a41d9a5012ac653e027bde Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:14:17 -0400 Subject: [PATCH 16/32] Update p9.c --- c/p9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p9.c b/c/p9.c index 62ae10a..1d0cbaf 100644 --- a/c/p9.c +++ b/c/p9.c @@ -9,7 +9,7 @@ */ #include - +#include int* filterMultiples(int* arr, int N, int* NOut, int num) { int numPrimes = 0; *NOut = 0; From fe36da7d466ff4183f4241aaa7e9cec7ebe561e2 Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:15:50 -0400 Subject: [PATCH 17/32] Update p2.cpp --- c/p2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p2.cpp b/c/p2.cpp index b803393..00b4199 100644 --- a/c/p2.cpp +++ b/c/p2.cpp @@ -1,6 +1,6 @@ #include using namespace std; - +//no error class A{ int variable; public: From 0ffb00fb83caca5f4963b9ada2c785b1ece3d334 Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:46:04 +0530 Subject: [PATCH 18/32] Update p4.py --- py/p4.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/p4.py b/py/p4.py index 2ae30d4..6c379cb 100644 --- a/py/p4.py +++ b/py/p4.py @@ -6,10 +6,10 @@ def countSort(arr): ans = [0 for i in range(len(arr))] for i in arr: count[i] += 1 - for i in range(k+1): + for i in range(1,k+1): count[i] += count[i-1] for i in range(len(arr)-1, -1, -1): - ans[count[arr[i]]] = arr[i] + ans[count[arr[i]]-1] = arr[i] count[arr[i]] -= 1 return ans From 09243a1106439f8c863ddfda3eb80e2d2cee5159 Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:46:39 +0530 Subject: [PATCH 19/32] Update p5.py --- py/p5.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/p5.py b/py/p5.py index 01e1d53..0ad5959 100644 --- a/py/p5.py +++ b/py/p5.py @@ -8,10 +8,10 @@ def get_number(): val1 = input('Enter a number: ') val1 = int(val1) - str_to_print = '{:.1f}'.format(val1) + str_to_print = '{1f}'.format(val1) return str_to_print except ValueError: - get_number() + return get_number() print(get_number()) From b864dfef0259b4001e656a66a46faf789b0a50ca Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:47:22 +0530 Subject: [PATCH 20/32] Update p6.py --- py/p6.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/p6.py b/py/p6.py index fc571ba..0976c01 100644 --- a/py/p6.py +++ b/py/p6.py @@ -6,7 +6,7 @@ def addBinary(a: str, b: str) -> str: i = len(a) - 1 j = len(b) - 1 - while i >= 0 or j >= 0: + while i >= 0 or j >= 0 or carry!=0: if i >= 0: carry += int(a[i]) i -= 1 From f635b6a5d8fc7a03009dedcc2714c7609000496f Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:17:26 -0400 Subject: [PATCH 21/32] Update p14.c --- c/p14.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/c/p14.c b/c/p14.c index 1a78b65..1f6ae67 100644 --- a/c/p14.c +++ b/c/p14.c @@ -22,7 +22,10 @@ int romanToInt(char * s){ if(a[i] < a[i+1]){ a[i+1] -= a[i]; } - num += a[i]; + else{ + num += a[i]; + + } } num += a[strlen(s) - 1]; return num; From 22a8612c4ba2bb336ef2682242a08a6e8c8082d0 Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:48:10 +0530 Subject: [PATCH 22/32] Update p8.py --- py/p8.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/py/p8.py b/py/p8.py index 4418074..03e47c3 100644 --- a/py/p8.py +++ b/py/p8.py @@ -27,7 +27,11 @@ def append_item(self, data): self.count += 1 def print_foward(self): - print(self.iter()) + current=self.head + while current: + item_val=current.data + current=current.next + print(item_val) def iter(self): # Iterate the list From d1b3a6826f8595ee784bd40b6c939861b8a885dc Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:48:30 +0530 Subject: [PATCH 23/32] Update p9.py --- py/p9.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/py/p9.py b/py/p9.py index 4ea1c58..c831eb5 100644 --- a/py/p9.py +++ b/py/p9.py @@ -9,9 +9,12 @@ def ispangram(str1, alphabet=string.ascii_lowercase): alphaset = list(alphabet) str = list(str1.lower()) - - # Check if all lowercase characters in the input string covers all characters in 'alphaset' - return alphaset <= str + for i in range (0,26): + if alphaset[i] not in str: + break + if i==25: + return True + return False # Print the result of checking if the string is a pangram by calling the 'ispangram' function print(ispangram('The quick brown fox jumps over the lazy dog')) From dc0f81e23fd8e3032d786ef5530414003ab963c8 Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:48:49 +0530 Subject: [PATCH 24/32] Update p9.py --- py/p9.py | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/py/p9.py b/py/p9.py index c831eb5..de034f1 100644 --- a/py/p9.py +++ b/py/p9.py @@ -1,20 +1,18 @@ -#Write a Python function to check whether a string is a pangram or not. -#Note : Pangrams are words or sentences containing every letter of the alphabet at least once. +#Finding Average RGB values using the listmaker fuction to generate list of rgb values for a pixel -import string -import sys +def listmaker(r,g,b,list1=[]): + if (list1!=[]): + list1=[] + list1.append(r) + list1.append(g) + list1.append(b) + return list1 -# Define a function named 'ispangram' that checks if a string is a pangram -def ispangram(str1, alphabet=string.ascii_lowercase): - alphaset = list(alphabet) - - str = list(str1.lower()) - for i in range (0,26): - if alphaset[i] not in str: - break - if i==25: - return True - return False - -# Print the result of checking if the string is a pangram by calling the 'ispangram' function -print(ispangram('The quick brown fox jumps over the lazy dog')) +pixel1=listmaker(23,78,34) +pixel2=listmaker(210,56,67) +pixel3=listmaker(23,78,248) +r=(pixel1[0]+pixel2[0]+pixel3[0])/3 +g=(pixel1[1]+pixel2[1]+pixel3[1])/3 +b=(pixel1[2]+pixel2[2]+pixel3[2])/3 +rgb=[r,g,b] +print("Average RGB values of the pixels are",rgb) From 58088a17a8454f584928744658a06b05fb91f604 Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:49:14 +0530 Subject: [PATCH 25/32] Update p10.py --- py/p10.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/p10.py b/py/p10.py index cfc822f..de034f1 100644 --- a/py/p10.py +++ b/py/p10.py @@ -1,6 +1,8 @@ #Finding Average RGB values using the listmaker fuction to generate list of rgb values for a pixel def listmaker(r,g,b,list1=[]): + if (list1!=[]): + list1=[] list1.append(r) list1.append(g) list1.append(b) From 9f6753be88222ffe0c4bc84546b55ba03cc80661 Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:49:36 +0530 Subject: [PATCH 26/32] Update p9.py --- py/p9.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/py/p9.py b/py/p9.py index de034f1..c831eb5 100644 --- a/py/p9.py +++ b/py/p9.py @@ -1,18 +1,20 @@ -#Finding Average RGB values using the listmaker fuction to generate list of rgb values for a pixel +#Write a Python function to check whether a string is a pangram or not. +#Note : Pangrams are words or sentences containing every letter of the alphabet at least once. -def listmaker(r,g,b,list1=[]): - if (list1!=[]): - list1=[] - list1.append(r) - list1.append(g) - list1.append(b) - return list1 +import string +import sys -pixel1=listmaker(23,78,34) -pixel2=listmaker(210,56,67) -pixel3=listmaker(23,78,248) -r=(pixel1[0]+pixel2[0]+pixel3[0])/3 -g=(pixel1[1]+pixel2[1]+pixel3[1])/3 -b=(pixel1[2]+pixel2[2]+pixel3[2])/3 -rgb=[r,g,b] -print("Average RGB values of the pixels are",rgb) +# Define a function named 'ispangram' that checks if a string is a pangram +def ispangram(str1, alphabet=string.ascii_lowercase): + alphaset = list(alphabet) + + str = list(str1.lower()) + for i in range (0,26): + if alphaset[i] not in str: + break + if i==25: + return True + return False + +# Print the result of checking if the string is a pangram by calling the 'ispangram' function +print(ispangram('The quick brown fox jumps over the lazy dog')) From 1a94defc6d294fc0180b0b4b9bd81679901c8427 Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:50:19 +0530 Subject: [PATCH 27/32] Update p11.py --- py/p11.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/py/p11.py b/py/p11.py index 3d35661..590adda 100644 --- a/py/p11.py +++ b/py/p11.py @@ -1,9 +1,9 @@ # Function to convert decimal to binary number def binaryconversion(n): - print(n % 2,end = '') - if n > 1: - binaryconversion(n/2) + if n >=1: + binaryconversion(n/2) + print(n % 2,end = '') number=int(input("Enter Number: ")) binaryconversion(number) From e8415e92bc792fbdd62b4696ddc223e82d197883 Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:22:29 -0400 Subject: [PATCH 28/32] Update p12.cpp --- c/p12.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p12.cpp b/c/p12.cpp index 29594f4..db9e967 100644 --- a/c/p12.cpp +++ b/c/p12.cpp @@ -1,6 +1,6 @@ //program to find the longest common subsequence (LCS) in two strings //e.g. ABCDE and AFCZE have a common subsequence of ACE - +//no errors #include using namespace std; From 7aa92f08113130e75c160f3e659fa95134de4cc3 Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:28:55 -0400 Subject: [PATCH 29/32] Update p1.cpp --- c/p1.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c/p1.cpp b/c/p1.cpp index f1af0d7..c8ece50 100644 --- a/c/p1.cpp +++ b/c/p1.cpp @@ -14,8 +14,8 @@ void checkSum(int a[], int n, int t){ table[i][0] = true; } - for(int i=1;i<=n;i++){ - for(int j=1;j<=t;j++){ + for(int i=0;i<=n;i++){ + for(int j=0;j<=t;j++){ if(j < a[i-1]){ table[i][j] = table[i-1][j]; } From cfba82df47d29289023f5592c1c04e16b3bfb4cc Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 12:01:33 +0530 Subject: [PATCH 30/32] Update p7.py --- py/p7.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/p7.py b/py/p7.py index ad7b53f..c773f2e 100644 --- a/py/p7.py +++ b/py/p7.py @@ -2,7 +2,7 @@ #e.g. 2->4->3 + 5->6->4 = 7->0->8 (342 + 465 = 807) # Definition for singly-linked list. -class ListNode(object): +class ListNode(object):#no error def __init__(self, val=0, next=None): self.val = val self.next = next From ebe230232d033642ce891e4d0e63a85d24050d16 Mon Sep 17 00:00:00 2001 From: Kishorekb2003 <132202728+Kishorekb2003@users.noreply.github.com> Date: Sat, 16 Mar 2024 02:31:34 -0400 Subject: [PATCH 31/32] Update p10.cpp --- c/p10.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/p10.cpp b/c/p10.cpp index 08b90e0..9ee4767 100644 --- a/c/p10.cpp +++ b/c/p10.cpp @@ -1,5 +1,5 @@ //CPP program to implement circular linked list - +//no error #include using namespace std; struct node{ //defining the structure of the node From b91f900c4fc5711d61bd5c20057a29fff80f0a0c Mon Sep 17 00:00:00 2001 From: SFARHAN23 <157383151+SFARHAN23@users.noreply.github.com> Date: Sat, 16 Mar 2024 12:02:00 +0530 Subject: [PATCH 32/32] Update p12.py --- py/p12.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/p12.py b/py/p12.py index c5b0f4d..37ab276 100644 --- a/py/p12.py +++ b/py/p12.py @@ -1,6 +1,6 @@ # Program to multiply two matrices using nested loops -A = [[1,2,3],[4,5,6],[7,8,9]] +A = [[1,2,3],[4,5,6],[7,8,9]] #no error B = [[10,11,12],[13,14,15],[16,17,18]] p = len(A)