From a6c79587f3e76164a48c72d32c2a78a283a233da Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:00:26 +0530 Subject: [PATCH 01/70] Create Vignesh_On_Date --- visa_prep/Vignesh_On_Date | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 visa_prep/Vignesh_On_Date diff --git a/visa_prep/Vignesh_On_Date b/visa_prep/Vignesh_On_Date new file mode 100644 index 000000000..fda155757 --- /dev/null +++ b/visa_prep/Vignesh_On_Date @@ -0,0 +1,6 @@ +x,y=map(int,input().split()) +#=input() +if x>=y: + print("YES") +else: + print("NO") From 95f868ad169903315febe6b74041bde3ed92b505 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:20:58 +0530 Subject: [PATCH 02/70] Create Vignesh_and_Gym --- visa_prep/Vignesh_and_Gym | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 visa_prep/Vignesh_and_Gym diff --git a/visa_prep/Vignesh_and_Gym b/visa_prep/Vignesh_and_Gym new file mode 100644 index 000000000..1e72cfff6 --- /dev/null +++ b/visa_prep/Vignesh_and_Gym @@ -0,0 +1,7 @@ +X, Y, Z = map(int, input().split()) +if Z >= X + Y: + print(2) +elif Z >= X: + print(1) +else: + print(0) From b856a4295eb9c875f7b6e3cf93082219b013b37c Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:26:04 +0530 Subject: [PATCH 03/70] Create Best_Coupon --- visa_prep/Best_Coupon | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 visa_prep/Best_Coupon diff --git a/visa_prep/Best_Coupon b/visa_prep/Best_Coupon new file mode 100644 index 000000000..32c2ed6c6 --- /dev/null +++ b/visa_prep/Best_Coupon @@ -0,0 +1,6 @@ +x=int(input()) +dis=0.1*x +dis100=100 +maxdis=max(dis,dis100) +res=x-maxdis +print(int(res)) From 576c16560a3556a5200927cd34c168bef5e3bae8 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:32:32 +0530 Subject: [PATCH 04/70] Create Bridge_Crossing --- visa_prep/Bridge_Crossing | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 visa_prep/Bridge_Crossing diff --git a/visa_prep/Bridge_Crossing b/visa_prep/Bridge_Crossing new file mode 100644 index 000000000..424210072 --- /dev/null +++ b/visa_prep/Bridge_Crossing @@ -0,0 +1,3 @@ +x,y,z=map(int,input().split()) +n=(z-y)//x +print(n) From e94fe51731cc950ce1397786289e95a939af6d79 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:35:23 +0530 Subject: [PATCH 05/70] Create Count_NoteBooks --- visa_prep/Count_NoteBooks | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 visa_prep/Count_NoteBooks diff --git a/visa_prep/Count_NoteBooks b/visa_prep/Count_NoteBooks new file mode 100644 index 000000000..7c56a20b4 --- /dev/null +++ b/visa_prep/Count_NoteBooks @@ -0,0 +1,3 @@ +n=int(input()) +books=n*10 +print(books) From bf91916b98769ab1e71b072b1a4a325cbe4e2015 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 19:37:52 +0530 Subject: [PATCH 06/70] Create Find_Age --- visa_prep/Find_Age | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 visa_prep/Find_Age diff --git a/visa_prep/Find_Age b/visa_prep/Find_Age new file mode 100644 index 000000000..b1fb03fbc --- /dev/null +++ b/visa_prep/Find_Age @@ -0,0 +1,3 @@ +x=int(input()) +y=x-15 +print(y) From f9aaa0adf6fa5ecf7951bb9005835bc246558833 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:25:16 +0530 Subject: [PATCH 07/70] Create Netflix_SUB --- visa_prep/Netflix_SUB | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 visa_prep/Netflix_SUB diff --git a/visa_prep/Netflix_SUB b/visa_prep/Netflix_SUB new file mode 100644 index 000000000..9d7f597a4 --- /dev/null +++ b/visa_prep/Netflix_SUB @@ -0,0 +1,5 @@ +a,b,c,x=map(int,input().split()) +if (a+b or b+c or a+c)>=x: + print("YES") +else: + print("NO") From 694b172293c0bab444543bf0398726e4a309238e Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:33:44 +0530 Subject: [PATCH 08/70] Create Pending_Assignments --- visa_prep/Pending_Assignments | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 visa_prep/Pending_Assignments diff --git a/visa_prep/Pending_Assignments b/visa_prep/Pending_Assignments new file mode 100644 index 000000000..cc9489028 --- /dev/null +++ b/visa_prep/Pending_Assignments @@ -0,0 +1,7 @@ +x,y,z=map(int,input().split()) +timetaken=x*y +time=z*24*60 +if timetaken<=time: + print("YES") +else: + print("NO") From 01354b2515be138ae2f2890ca66e8e0560868ecf Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:41:04 +0530 Subject: [PATCH 09/70] Create R_P_S --- visa_prep/R_P_S | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 visa_prep/R_P_S diff --git a/visa_prep/R_P_S b/visa_prep/R_P_S new file mode 100644 index 000000000..fe25984c3 --- /dev/null +++ b/visa_prep/R_P_S @@ -0,0 +1,7 @@ +x,y=map(str,input().split()) +if x==y: + print("NULL") +elif (x=="R" and y=="P") or (x=="P" and y=="S") or (x=="S" and y=="R"): + print("Charan") +else: + print("Vignesh") From 3e5aa7cf9522a5fb29b596c44ddad7a585d6224e Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:50:38 +0530 Subject: [PATCH 10/70] Create Test_Score --- visa_prep/Test_Score | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 visa_prep/Test_Score diff --git a/visa_prep/Test_Score b/visa_prep/Test_Score new file mode 100644 index 000000000..5aed8a6d9 --- /dev/null +++ b/visa_prep/Test_Score @@ -0,0 +1,6 @@ +n,x,y=map(int,input().split()) +marks=n*x +if 0<=y<=marks and y%x==0: + print("YES") +else: + print("NO") From 992f525bdec3ee392d48e832c623fedbca7b306b Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 20:57:44 +0530 Subject: [PATCH 11/70] Create Round_Table --- visa_prep/Round_Table | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 visa_prep/Round_Table diff --git a/visa_prep/Round_Table b/visa_prep/Round_Table new file mode 100644 index 000000000..762485fb4 --- /dev/null +++ b/visa_prep/Round_Table @@ -0,0 +1,4 @@ +import math +X = int(input()) +ways = math.factorial(X) +print(ways) From d2aa32de37e7aa9f31fae0fd058307582754963b Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:01:49 +0530 Subject: [PATCH 12/70] Create Leap_Year.py --- visa_prep/Leap_Year.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 visa_prep/Leap_Year.py diff --git a/visa_prep/Leap_Year.py b/visa_prep/Leap_Year.py new file mode 100644 index 000000000..92cbefb7a --- /dev/null +++ b/visa_prep/Leap_Year.py @@ -0,0 +1,5 @@ +x=int(input()) +if (x % 4 == 0 and x % 100 != 0) or (x % 400 == 0): + print("YES") +else: + print("NO") From c5a7486238b24eaaf3f3de32c1a54b52c568e036 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:04:52 +0530 Subject: [PATCH 13/70] Delete visa_prep/Best_Coupon --- visa_prep/Best_Coupon | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 visa_prep/Best_Coupon diff --git a/visa_prep/Best_Coupon b/visa_prep/Best_Coupon deleted file mode 100644 index 32c2ed6c6..000000000 --- a/visa_prep/Best_Coupon +++ /dev/null @@ -1,6 +0,0 @@ -x=int(input()) -dis=0.1*x -dis100=100 -maxdis=max(dis,dis100) -res=x-maxdis -print(int(res)) From 6baeeb30546053efc7caa2e063bef851f4d5a07f Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:05:40 +0530 Subject: [PATCH 14/70] Create Best_Coupon.py --- visa_prep/Best_Coupon.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 visa_prep/Best_Coupon.py diff --git a/visa_prep/Best_Coupon.py b/visa_prep/Best_Coupon.py new file mode 100644 index 000000000..32c2ed6c6 --- /dev/null +++ b/visa_prep/Best_Coupon.py @@ -0,0 +1,6 @@ +x=int(input()) +dis=0.1*x +dis100=100 +maxdis=max(dis,dis100) +res=x-maxdis +print(int(res)) From d665fff80e4cb9cff3a25a1e52d50283efa1b784 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:06:18 +0530 Subject: [PATCH 15/70] Delete visa_prep/Bridge_Crossing --- visa_prep/Bridge_Crossing | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 visa_prep/Bridge_Crossing diff --git a/visa_prep/Bridge_Crossing b/visa_prep/Bridge_Crossing deleted file mode 100644 index 424210072..000000000 --- a/visa_prep/Bridge_Crossing +++ /dev/null @@ -1,3 +0,0 @@ -x,y,z=map(int,input().split()) -n=(z-y)//x -print(n) From f6517b3a2e0cf7598b9a21bf55cf67c5f9f897ed Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:06:36 +0530 Subject: [PATCH 16/70] Create Bridge_Crossing.py --- visa_prep/Bridge_Crossing.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 visa_prep/Bridge_Crossing.py diff --git a/visa_prep/Bridge_Crossing.py b/visa_prep/Bridge_Crossing.py new file mode 100644 index 000000000..424210072 --- /dev/null +++ b/visa_prep/Bridge_Crossing.py @@ -0,0 +1,3 @@ +x,y,z=map(int,input().split()) +n=(z-y)//x +print(n) From 3b26a71ee4cbbe4fdfff8150fcdd9421fa0c672c Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:07:07 +0530 Subject: [PATCH 17/70] Delete visa_prep/Count_NoteBooks --- visa_prep/Count_NoteBooks | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 visa_prep/Count_NoteBooks diff --git a/visa_prep/Count_NoteBooks b/visa_prep/Count_NoteBooks deleted file mode 100644 index 7c56a20b4..000000000 --- a/visa_prep/Count_NoteBooks +++ /dev/null @@ -1,3 +0,0 @@ -n=int(input()) -books=n*10 -print(books) From cb00f40fc2f6455e3d00a622d2327dddb3b6e7ad Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:07:33 +0530 Subject: [PATCH 18/70] Create Count_Notebooks.py --- visa_prep/Count_Notebooks.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 visa_prep/Count_Notebooks.py diff --git a/visa_prep/Count_Notebooks.py b/visa_prep/Count_Notebooks.py new file mode 100644 index 000000000..7c56a20b4 --- /dev/null +++ b/visa_prep/Count_Notebooks.py @@ -0,0 +1,3 @@ +n=int(input()) +books=n*10 +print(books) From cc24da141e57775400534a6258c0bf6cbb8e430d Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:07:53 +0530 Subject: [PATCH 19/70] Delete visa_prep/Find_Age --- visa_prep/Find_Age | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 visa_prep/Find_Age diff --git a/visa_prep/Find_Age b/visa_prep/Find_Age deleted file mode 100644 index b1fb03fbc..000000000 --- a/visa_prep/Find_Age +++ /dev/null @@ -1,3 +0,0 @@ -x=int(input()) -y=x-15 -print(y) From 2d1eb6131973de7239af34a9355ff75e3308b09b Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:08:13 +0530 Subject: [PATCH 20/70] Create Find_Age.py --- visa_prep/Find_Age.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 visa_prep/Find_Age.py diff --git a/visa_prep/Find_Age.py b/visa_prep/Find_Age.py new file mode 100644 index 000000000..b1fb03fbc --- /dev/null +++ b/visa_prep/Find_Age.py @@ -0,0 +1,3 @@ +x=int(input()) +y=x-15 +print(y) From c25ffa29194d73f8edac0ae656d0ef292dab2ffc Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:08:36 +0530 Subject: [PATCH 21/70] Delete visa_prep/Netflix_SUB --- visa_prep/Netflix_SUB | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 visa_prep/Netflix_SUB diff --git a/visa_prep/Netflix_SUB b/visa_prep/Netflix_SUB deleted file mode 100644 index 9d7f597a4..000000000 --- a/visa_prep/Netflix_SUB +++ /dev/null @@ -1,5 +0,0 @@ -a,b,c,x=map(int,input().split()) -if (a+b or b+c or a+c)>=x: - print("YES") -else: - print("NO") From a5b5f890272b7f415c04d0ace659bcdd339ee596 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:08:59 +0530 Subject: [PATCH 22/70] Create Netflix_SUB.py --- visa_prep/Netflix_SUB.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 visa_prep/Netflix_SUB.py diff --git a/visa_prep/Netflix_SUB.py b/visa_prep/Netflix_SUB.py new file mode 100644 index 000000000..9d7f597a4 --- /dev/null +++ b/visa_prep/Netflix_SUB.py @@ -0,0 +1,5 @@ +a,b,c,x=map(int,input().split()) +if (a+b or b+c or a+c)>=x: + print("YES") +else: + print("NO") From 1dc87ccc921d6cb2289cc9c7bf4c04d92753b703 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:09:19 +0530 Subject: [PATCH 23/70] Delete visa_prep/Pending_Assignments --- visa_prep/Pending_Assignments | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 visa_prep/Pending_Assignments diff --git a/visa_prep/Pending_Assignments b/visa_prep/Pending_Assignments deleted file mode 100644 index cc9489028..000000000 --- a/visa_prep/Pending_Assignments +++ /dev/null @@ -1,7 +0,0 @@ -x,y,z=map(int,input().split()) -timetaken=x*y -time=z*24*60 -if timetaken<=time: - print("YES") -else: - print("NO") From a949eaf7f952dd927b8fced176a83d1ac9bf7af7 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:09:40 +0530 Subject: [PATCH 24/70] Create Pending_Assignments.py --- visa_prep/Pending_Assignments.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 visa_prep/Pending_Assignments.py diff --git a/visa_prep/Pending_Assignments.py b/visa_prep/Pending_Assignments.py new file mode 100644 index 000000000..cc9489028 --- /dev/null +++ b/visa_prep/Pending_Assignments.py @@ -0,0 +1,7 @@ +x,y,z=map(int,input().split()) +timetaken=x*y +time=z*24*60 +if timetaken<=time: + print("YES") +else: + print("NO") From 5f2afcf4bd4a8a11ec74d939da3e8bd4cd8c3f87 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:10:03 +0530 Subject: [PATCH 25/70] Delete visa_prep/R_P_S --- visa_prep/R_P_S | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 visa_prep/R_P_S diff --git a/visa_prep/R_P_S b/visa_prep/R_P_S deleted file mode 100644 index fe25984c3..000000000 --- a/visa_prep/R_P_S +++ /dev/null @@ -1,7 +0,0 @@ -x,y=map(str,input().split()) -if x==y: - print("NULL") -elif (x=="R" and y=="P") or (x=="P" and y=="S") or (x=="S" and y=="R"): - print("Charan") -else: - print("Vignesh") From 935660364df8803cf37656547aa104896bffeafd Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:10:20 +0530 Subject: [PATCH 26/70] Create P_P_S.py --- visa_prep/P_P_S.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 visa_prep/P_P_S.py diff --git a/visa_prep/P_P_S.py b/visa_prep/P_P_S.py new file mode 100644 index 000000000..fe25984c3 --- /dev/null +++ b/visa_prep/P_P_S.py @@ -0,0 +1,7 @@ +x,y=map(str,input().split()) +if x==y: + print("NULL") +elif (x=="R" and y=="P") or (x=="P" and y=="S") or (x=="S" and y=="R"): + print("Charan") +else: + print("Vignesh") From 9ee0fce2ea5f8017d6cd4295dfcebe90eae3f8b1 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:10:41 +0530 Subject: [PATCH 27/70] Delete visa_prep/Round_Table --- visa_prep/Round_Table | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 visa_prep/Round_Table diff --git a/visa_prep/Round_Table b/visa_prep/Round_Table deleted file mode 100644 index 762485fb4..000000000 --- a/visa_prep/Round_Table +++ /dev/null @@ -1,4 +0,0 @@ -import math -X = int(input()) -ways = math.factorial(X) -print(ways) From b45bc4fddaa5e0347d407589541d5f78e3d0155d Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:10:58 +0530 Subject: [PATCH 28/70] Create Round_Table.py --- visa_prep/Round_Table.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 visa_prep/Round_Table.py diff --git a/visa_prep/Round_Table.py b/visa_prep/Round_Table.py new file mode 100644 index 000000000..762485fb4 --- /dev/null +++ b/visa_prep/Round_Table.py @@ -0,0 +1,4 @@ +import math +X = int(input()) +ways = math.factorial(X) +print(ways) From fe16a4c0119202ae7d2766839a00179e9b5bd67a Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:11:18 +0530 Subject: [PATCH 29/70] Delete visa_prep/Test_Score --- visa_prep/Test_Score | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 visa_prep/Test_Score diff --git a/visa_prep/Test_Score b/visa_prep/Test_Score deleted file mode 100644 index 5aed8a6d9..000000000 --- a/visa_prep/Test_Score +++ /dev/null @@ -1,6 +0,0 @@ -n,x,y=map(int,input().split()) -marks=n*x -if 0<=y<=marks and y%x==0: - print("YES") -else: - print("NO") From 2881b1f1449fe732df1d0abdff6623b620918808 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:11:40 +0530 Subject: [PATCH 30/70] Create Test_Score.py --- visa_prep/Test_Score.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 visa_prep/Test_Score.py diff --git a/visa_prep/Test_Score.py b/visa_prep/Test_Score.py new file mode 100644 index 000000000..5aed8a6d9 --- /dev/null +++ b/visa_prep/Test_Score.py @@ -0,0 +1,6 @@ +n,x,y=map(int,input().split()) +marks=n*x +if 0<=y<=marks and y%x==0: + print("YES") +else: + print("NO") From 1db90bc2136c9552c5e590378c5d0da27f91dad9 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:11:58 +0530 Subject: [PATCH 31/70] Delete visa_prep/Vignesh_On_Date --- visa_prep/Vignesh_On_Date | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 visa_prep/Vignesh_On_Date diff --git a/visa_prep/Vignesh_On_Date b/visa_prep/Vignesh_On_Date deleted file mode 100644 index fda155757..000000000 --- a/visa_prep/Vignesh_On_Date +++ /dev/null @@ -1,6 +0,0 @@ -x,y=map(int,input().split()) -#=input() -if x>=y: - print("YES") -else: - print("NO") From 653716a32cda4027da04bde7ab90d6d2ab4c7f49 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:12:16 +0530 Subject: [PATCH 32/70] Create Vignesh_On_Date.py --- visa_prep/Vignesh_On_Date.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 visa_prep/Vignesh_On_Date.py diff --git a/visa_prep/Vignesh_On_Date.py b/visa_prep/Vignesh_On_Date.py new file mode 100644 index 000000000..fda155757 --- /dev/null +++ b/visa_prep/Vignesh_On_Date.py @@ -0,0 +1,6 @@ +x,y=map(int,input().split()) +#=input() +if x>=y: + print("YES") +else: + print("NO") From 84641e190d84bce2252c0c77649bb0a90f1ae80d Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:12:33 +0530 Subject: [PATCH 33/70] Delete visa_prep/Vignesh_and_Gym --- visa_prep/Vignesh_and_Gym | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 visa_prep/Vignesh_and_Gym diff --git a/visa_prep/Vignesh_and_Gym b/visa_prep/Vignesh_and_Gym deleted file mode 100644 index 1e72cfff6..000000000 --- a/visa_prep/Vignesh_and_Gym +++ /dev/null @@ -1,7 +0,0 @@ -X, Y, Z = map(int, input().split()) -if Z >= X + Y: - print(2) -elif Z >= X: - print(1) -else: - print(0) From 9900b98ae41e12f0a99bd27eeeff49912e62ac1c Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:12:52 +0530 Subject: [PATCH 34/70] Create Vignesh_and_Gym.py --- visa_prep/Vignesh_and_Gym.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 visa_prep/Vignesh_and_Gym.py diff --git a/visa_prep/Vignesh_and_Gym.py b/visa_prep/Vignesh_and_Gym.py new file mode 100644 index 000000000..1e72cfff6 --- /dev/null +++ b/visa_prep/Vignesh_and_Gym.py @@ -0,0 +1,7 @@ +X, Y, Z = map(int, input().split()) +if Z >= X + Y: + print(2) +elif Z >= X: + print(1) +else: + print(0) From 1dfa6e9a1184cd997760e8fc8a6fb804f9f23e2b Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:15:56 +0530 Subject: [PATCH 35/70] Create Valentine's_Day.py --- visa_prep/Valentine's_Day.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 visa_prep/Valentine's_Day.py diff --git a/visa_prep/Valentine's_Day.py b/visa_prep/Valentine's_Day.py new file mode 100644 index 000000000..be6a8120c --- /dev/null +++ b/visa_prep/Valentine's_Day.py @@ -0,0 +1,3 @@ +X, Y = map(int, input().split()) +max_chocolates = X // Y +print(max_chocolates) From e50439a382868df72d71d23b2a5ede603b3af853 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:19:02 +0530 Subject: [PATCH 36/70] Create AirLines.py --- visa_prep/AirLines.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 visa_prep/AirLines.py diff --git a/visa_prep/AirLines.py b/visa_prep/AirLines.py new file mode 100644 index 000000000..22c331e5e --- /dev/null +++ b/visa_prep/AirLines.py @@ -0,0 +1,9 @@ + +X, N = map(int, input().split()) +c = X * 100 +if N > c: + rp = N - c + ap = (rp + 99) // 100 +else: + ap = 0 +print(ap) From 747464d0353d2fe45c9e93936b87a5b3833b98b6 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:22:59 +0530 Subject: [PATCH 37/70] Create Season_Game.py --- visa_prep/Season_Game.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 visa_prep/Season_Game.py diff --git a/visa_prep/Season_Game.py b/visa_prep/Season_Game.py new file mode 100644 index 000000000..3e26eefcf --- /dev/null +++ b/visa_prep/Season_Game.py @@ -0,0 +1,11 @@ +N = int(input()) +if 3 <= N <= 5: + print("Spring") +elif 6 <= N <= 8: + print("Summer") +elif 9 <= N <= 11: + print("Autumn") +elif N == 12 or 1 <= N <= 2: + print("Winter") +else: + print("Invalid") From 2e6dcdecab58356f5ca4cafa9f3666001c5a8f2e Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:26:24 +0530 Subject: [PATCH 38/70] Create String_Reduce.py --- visa_prep/String_Reduce.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 visa_prep/String_Reduce.py diff --git a/visa_prep/String_Reduce.py b/visa_prep/String_Reduce.py new file mode 100644 index 000000000..a8a46f5da --- /dev/null +++ b/visa_prep/String_Reduce.py @@ -0,0 +1,13 @@ +def reduce_string(s): + res = [] + c = 1 + for i in range(1, len(s)): + if s[i] == s[i-1]: + c += 1 + else: + res.append(s[i-1] + str(c)) + c= 1 + res.append(s[-1] + str(c)) + return ''.join(res) +input= input().strip() +print(reduce_string(input)) From b358dcece908034a9247150e041332e0fc469100 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:28:49 +0530 Subject: [PATCH 39/70] Create Ajay's_Score_Calculation.py --- visa_prep/Ajay's_Score_Calculation.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 visa_prep/Ajay's_Score_Calculation.py diff --git a/visa_prep/Ajay's_Score_Calculation.py b/visa_prep/Ajay's_Score_Calculation.py new file mode 100644 index 000000000..47e7d57dc --- /dev/null +++ b/visa_prep/Ajay's_Score_Calculation.py @@ -0,0 +1,6 @@ +T = int(input()) +for _ in range(T): + X, N = map(int, input().split()) + p = X // 10 + res = p* N + print(res) From e1750310a5bbae3a38322ede93a05c6b343b97ae Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:34:25 +0530 Subject: [PATCH 40/70] Create BIT_SET.py --- visa_prep/BIT_SET.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 visa_prep/BIT_SET.py diff --git a/visa_prep/BIT_SET.py b/visa_prep/BIT_SET.py new file mode 100644 index 000000000..cc85ea404 --- /dev/null +++ b/visa_prep/BIT_SET.py @@ -0,0 +1,7 @@ +N=int(input()) +k=int(input()) +if N & (1 << (k - 1)): + print("true") +else: + print("false") + From 94c884cf6f642a3200ca4b26c244031d933cb2cd Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:37:48 +0530 Subject: [PATCH 41/70] Create Triangle_pattern_2.py --- visa_prep/Triangle_pattern_2.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 visa_prep/Triangle_pattern_2.py diff --git a/visa_prep/Triangle_pattern_2.py b/visa_prep/Triangle_pattern_2.py new file mode 100644 index 000000000..03661135a --- /dev/null +++ b/visa_prep/Triangle_pattern_2.py @@ -0,0 +1,3 @@ +N = int(input()) +for i in range(1, N + 1): + print(" ".join([str(i)] * i)) From d1e269d74fc3c29ca2b1c541666e16cecad655d7 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 09:56:07 +0530 Subject: [PATCH 42/70] Create Score_Calculation.py --- visa_prep/Score_Calculation.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 visa_prep/Score_Calculation.py diff --git a/visa_prep/Score_Calculation.py b/visa_prep/Score_Calculation.py new file mode 100644 index 000000000..9a15a3f5d --- /dev/null +++ b/visa_prep/Score_Calculation.py @@ -0,0 +1,6 @@ +T=int(input()) +for _ in range(T): + X,N=map(int,input().split()) + p=X//10 + res=p*N + print(res) From 0c3058d04966445f3ef83466d593e281ce1694f1 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:08:23 +0530 Subject: [PATCH 43/70] Create On_Time_Arrival.py --- visa_prep/On_Time_Arrival.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 visa_prep/On_Time_Arrival.py diff --git a/visa_prep/On_Time_Arrival.py b/visa_prep/On_Time_Arrival.py new file mode 100644 index 000000000..91940bbf2 --- /dev/null +++ b/visa_prep/On_Time_Arrival.py @@ -0,0 +1,7 @@ +T=int(input()) +for _ in range(T): + X=int(input()) + if X>=30: + print("YES") + else: + print("NO") From dae6f39e450ccd9092d9b1d145f3b1906ecb80aa Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:12:11 +0530 Subject: [PATCH 44/70] Create Even_Odd_Game_1.py --- visa_prep/Even_Odd_Game_1.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 visa_prep/Even_Odd_Game_1.py diff --git a/visa_prep/Even_Odd_Game_1.py b/visa_prep/Even_Odd_Game_1.py new file mode 100644 index 000000000..2662324fb --- /dev/null +++ b/visa_prep/Even_Odd_Game_1.py @@ -0,0 +1,6 @@ +N=input().strip() +ds=sum(int(digit) for digit in N) +if ds%2==0: + print("Vignesh") +else: + print("Charan") From 79f3427ca4729fb76c0e890fbfc5607dc1891f5a Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:16:20 +0530 Subject: [PATCH 45/70] Create Triangle_pattern_1.py --- visa_prep/Triangle_pattern_1.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 visa_prep/Triangle_pattern_1.py diff --git a/visa_prep/Triangle_pattern_1.py b/visa_prep/Triangle_pattern_1.py new file mode 100644 index 000000000..56e5fc947 --- /dev/null +++ b/visa_prep/Triangle_pattern_1.py @@ -0,0 +1,8 @@ +N=int(input()) +cn=1 +for i in range(1,N+1): + rn=[] + for j in range(i): + rn.append(cn) + cn+=1 + print(" ".join(map(str,rn))) From baa660b0d37edfc1a457a0e366e011690b527b6a Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:20:50 +0530 Subject: [PATCH 46/70] Create Ticket_Fever.py --- visa_prep/Ticket_Fever.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 visa_prep/Ticket_Fever.py diff --git a/visa_prep/Ticket_Fever.py b/visa_prep/Ticket_Fever.py new file mode 100644 index 000000000..d8980aceb --- /dev/null +++ b/visa_prep/Ticket_Fever.py @@ -0,0 +1,5 @@ +T=int(input()) +for _ in range(T): + N,M=map(int,input().split()) + st=max(0,N-M) + print(st) From 464595985bcf3c9fd7f4547b116a54f7f3a4333f Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:24:06 +0530 Subject: [PATCH 47/70] Create Factorial_1.py --- visa_prep/Factorial_1.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 visa_prep/Factorial_1.py diff --git a/visa_prep/Factorial_1.py b/visa_prep/Factorial_1.py new file mode 100644 index 000000000..0df9b2daf --- /dev/null +++ b/visa_prep/Factorial_1.py @@ -0,0 +1,9 @@ +def fact(n): + if n==0: + return 1 + res=1 + for i in range(1,n+1): + res*=i + return res +n=int(input()) +print(fact(n)) From 864e9b77882edf526eedcf36aed552222ac48fc9 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:27:10 +0530 Subject: [PATCH 48/70] Create Reverse_Array.py --- visa_prep/Reverse_Array.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 visa_prep/Reverse_Array.py diff --git a/visa_prep/Reverse_Array.py b/visa_prep/Reverse_Array.py new file mode 100644 index 000000000..5a04abea2 --- /dev/null +++ b/visa_prep/Reverse_Array.py @@ -0,0 +1,4 @@ +n=int(input()) +a=list(map(int,input().split())) +ra=a[::-1] +print(" ".join(map(str,ra))) From 78d54fe8b97e18947f460c7badcad2c62286664a Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:46:17 +0530 Subject: [PATCH 49/70] Create isBalance_ElevateBox.py --- visa_prep/isBalance_ElevateBox.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 visa_prep/isBalance_ElevateBox.py diff --git a/visa_prep/isBalance_ElevateBox.py b/visa_prep/isBalance_ElevateBox.py new file mode 100644 index 000000000..f873c562c --- /dev/null +++ b/visa_prep/isBalance_ElevateBox.py @@ -0,0 +1,11 @@ +N=int(input()) +A=list(map(int,input().split())) +ts=sum(A) +ls=0 +ba=[] +for i in range(N): + rs=ts-ls-A[i] + b=abs(ls-rs) + ba.append(b) + ls+=A[i] +print(" ".join(map(str,ba))) From 991db1c1d5be189126c19f911a0d3b21f96a0076 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:18:26 +0530 Subject: [PATCH 50/70] Create Reverse_Integer.py --- visa_prep/Reverse_Integer.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 visa_prep/Reverse_Integer.py diff --git a/visa_prep/Reverse_Integer.py b/visa_prep/Reverse_Integer.py new file mode 100644 index 000000000..46c273e50 --- /dev/null +++ b/visa_prep/Reverse_Integer.py @@ -0,0 +1,17 @@ +def reverseint(n): + min=-2**31 + max=2**31-1 + sign=-1 if n<0 else 1 + n*=sign + revn=0 + while n>0: + dig=n%10 + n//=10 + revn=revn*10+dig + revn*=sign + if revnmax: + return 0 + return revn +n=int(input().strip()) +res=reverseint(n) +print(res) From f7082651f3c39afb5607d407eeea1e0d0c265fe8 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:23:48 +0530 Subject: [PATCH 51/70] Create Mirror_magic.py --- visa_prep/Mirror_magic.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 visa_prep/Mirror_magic.py diff --git a/visa_prep/Mirror_magic.py b/visa_prep/Mirror_magic.py new file mode 100644 index 000000000..6f00da07d --- /dev/null +++ b/visa_prep/Mirror_magic.py @@ -0,0 +1,13 @@ +def mirr(mat): + mm=[] + for row in mat: + mm.append(row[::-1]) + return mm +N=int(input().strip()) +mat=[] +for _ in range(N): + row=list(map(int,input().strip().split())) + mat.append(row) +mm=mirr(mat) +for row in mm: + print(" ".join(map(str,row))) From 8e7b9789347a8ab3ebae7fb1ff350c05f9363d73 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:32:16 +0530 Subject: [PATCH 52/70] Create DND.py --- visa_prep/DND.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 visa_prep/DND.py diff --git a/visa_prep/DND.py b/visa_prep/DND.py new file mode 100644 index 000000000..db242e1e3 --- /dev/null +++ b/visa_prep/DND.py @@ -0,0 +1,13 @@ +def cd(N,m,arr): + n1=0 + n2=0 + for number in arr: + if number%m==0: + n2+=number + else: + n1+=number + return n2-n1 +N,m=map(int,input().strip().split()) +arr=list(map(int,input().strip().split())) +res=cd(N,m,arr) +print(res) From 724b29289bb037ec1ac5b5d158bf35f8e5536798 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:36:06 +0530 Subject: [PATCH 53/70] Create Multiple_Challenge.py --- visa_prep/Multiple_Challenge.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 visa_prep/Multiple_Challenge.py diff --git a/visa_prep/Multiple_Challenge.py b/visa_prep/Multiple_Challenge.py new file mode 100644 index 000000000..eb18b21c7 --- /dev/null +++ b/visa_prep/Multiple_Challenge.py @@ -0,0 +1,8 @@ +def cd(N): + c=0 + for i in range(1,N+1): + if i%3==0 or i%5==0: + c+=1 + return c +N=int(input().strip()) +res=cd(N) From 4ea0213cca935e0b46941d1304122f395a5bd0ff Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:38:38 +0530 Subject: [PATCH 54/70] Delete visa_prep/Multiple_Challenge.py --- visa_prep/Multiple_Challenge.py | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 visa_prep/Multiple_Challenge.py diff --git a/visa_prep/Multiple_Challenge.py b/visa_prep/Multiple_Challenge.py deleted file mode 100644 index eb18b21c7..000000000 --- a/visa_prep/Multiple_Challenge.py +++ /dev/null @@ -1,8 +0,0 @@ -def cd(N): - c=0 - for i in range(1,N+1): - if i%3==0 or i%5==0: - c+=1 - return c -N=int(input().strip()) -res=cd(N) From 327684cc249238ab97b98074754bda045f9b2c2a Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:39:12 +0530 Subject: [PATCH 55/70] Create Multiple_Challenge.py --- visa_prep/Multiple_Challenge.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 visa_prep/Multiple_Challenge.py diff --git a/visa_prep/Multiple_Challenge.py b/visa_prep/Multiple_Challenge.py new file mode 100644 index 000000000..176f74e5c --- /dev/null +++ b/visa_prep/Multiple_Challenge.py @@ -0,0 +1,8 @@ +def cd(N): + c3=N//3 + c5=N//5 + c15=N//15 + c=c3+c5-c15 + return c +N=int(input().strip()) +res=cd(N) From d124b6358ef3dec2cbbcab4fedb1a16ba123c9ac Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:45:18 +0530 Subject: [PATCH 56/70] Create Pair_Sum_1.py --- visa_prep/Pair_Sum_1.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 visa_prep/Pair_Sum_1.py diff --git a/visa_prep/Pair_Sum_1.py b/visa_prep/Pair_Sum_1.py new file mode 100644 index 000000000..ce84cb026 --- /dev/null +++ b/visa_prep/Pair_Sum_1.py @@ -0,0 +1,15 @@ +def ps(arr,k): + s=set() + for number in arr: + com=k-number + if com in s: + return True + s.add(number) + return False +N=int(input().strip()) +arr=list(map(int,input().strip().split())) +k=int(input().strip()) +if ps(arr,k): + print("true") +else: + print("false") From a9dbd763b2fe8f42d62863af0356ad7c983f82eb Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:52:07 +0530 Subject: [PATCH 57/70] Create In_the_Range_or_Not.py --- visa_prep/In_the_Range_or_Not.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 visa_prep/In_the_Range_or_Not.py diff --git a/visa_prep/In_the_Range_or_Not.py b/visa_prep/In_the_Range_or_Not.py new file mode 100644 index 000000000..89ab30e8d --- /dev/null +++ b/visa_prep/In_the_Range_or_Not.py @@ -0,0 +1,7 @@ +T=int(input()) +for _ in range(T): + X=int(input()) + if 67<=X<=45000: + print("YES") + else: + print("NO") From ad3317a1eca0cd0e745480813fa23ce782283673 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 19:57:22 +0530 Subject: [PATCH 58/70] Create Reache_the_Target.py --- visa_prep/Reache_the_Target.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 visa_prep/Reache_the_Target.py diff --git a/visa_prep/Reache_the_Target.py b/visa_prep/Reache_the_Target.py new file mode 100644 index 000000000..2a44b5647 --- /dev/null +++ b/visa_prep/Reache_the_Target.py @@ -0,0 +1,5 @@ +T=int(input()) +for _ in range(T): + X,Y=map(int,input().split()) + rn=(X-Y)+1 + print(rn) From 88538fe8c7bb296631c506967a7985256b1b30ff Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Fri, 15 Nov 2024 20:00:23 +0530 Subject: [PATCH 59/70] Create Palindrome_Check.py --- visa_prep/Palindrome_Check.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 visa_prep/Palindrome_Check.py diff --git a/visa_prep/Palindrome_Check.py b/visa_prep/Palindrome_Check.py new file mode 100644 index 000000000..0ed2d0e6e --- /dev/null +++ b/visa_prep/Palindrome_Check.py @@ -0,0 +1,5 @@ +s=input().strip() +if s==s[::-1]: + print("TRUE") +else: + print("FALSE") From 422b544cebee991ae83d3297df96d8233d458b4a Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Sun, 17 Nov 2024 10:00:09 +0530 Subject: [PATCH 60/70] Create Single_Number.py --- visa_prep/Single_Number.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 visa_prep/Single_Number.py diff --git a/visa_prep/Single_Number.py b/visa_prep/Single_Number.py new file mode 100644 index 000000000..6df2d60b4 --- /dev/null +++ b/visa_prep/Single_Number.py @@ -0,0 +1,9 @@ +def fn(arr): + res=0 + for num in arr: + res^=num + return res +N=int(input().strip()) +arr=list(map(int,input().strip().split())) +sn=fn(arr) +print(sn) From e8b96bcbd768f531a1fab60ce1a3dfde10361cd1 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Sun, 17 Nov 2024 12:03:18 +0530 Subject: [PATCH 61/70] Create is_Array_Sorted.py --- visa_prep/is_Array_Sorted.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 visa_prep/is_Array_Sorted.py diff --git a/visa_prep/is_Array_Sorted.py b/visa_prep/is_Array_Sorted.py new file mode 100644 index 000000000..d9a06a4d8 --- /dev/null +++ b/visa_prep/is_Array_Sorted.py @@ -0,0 +1,6 @@ +N=int(input()) +X=list(map(int,input().split())) +if X==sorted(X): + print("true") +else: + print("false") From 7b47c83a9f5ff8a3a90ce0dae6df1a46ec6baeba Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Sun, 17 Nov 2024 12:14:45 +0530 Subject: [PATCH 62/70] Create Matrix_Sum.py --- visa_prep/Matrix_Sum.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 visa_prep/Matrix_Sum.py diff --git a/visa_prep/Matrix_Sum.py b/visa_prep/Matrix_Sum.py new file mode 100644 index 000000000..30998ab42 --- /dev/null +++ b/visa_prep/Matrix_Sum.py @@ -0,0 +1,9 @@ +def smat(N,mat): + rs=[sum(mat[i]) for i in range(N)] + cs=[sum(mat[i][j] for i in range(N)) for j in range(N)] + res=[rs[i]+cs[i] for i in range(N)] + return res +N=int(input()) +mat=[list(map(int,input().split())) for _ in range(N)] +res=smat(N,mat) +print(" ".join(map(s From d9afadb5fbafde0be35ef4170205bed30af658a8 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Sun, 17 Nov 2024 12:19:54 +0530 Subject: [PATCH 63/70] Create Vignesh's_Greed.py --- visa_prep/Vignesh's_Greed.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 visa_prep/Vignesh's_Greed.py diff --git a/visa_prep/Vignesh's_Greed.py b/visa_prep/Vignesh's_Greed.py new file mode 100644 index 000000000..f20d064ef --- /dev/null +++ b/visa_prep/Vignesh's_Greed.py @@ -0,0 +1,9 @@ +def mt(N,s): + s.sort(reverse=True) + for i in range(N-2): + if s[i] Date: Sun, 17 Nov 2024 12:40:02 +0530 Subject: [PATCH 64/70] Create shift_array_K.py --- visa_prep/shift_array_K.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 visa_prep/shift_array_K.py diff --git a/visa_prep/shift_array_K.py b/visa_prep/shift_array_K.py new file mode 100644 index 000000000..4b12824c9 --- /dev/null +++ b/visa_prep/shift_array_K.py @@ -0,0 +1,8 @@ +def ra(n,arr,k): + k=k%n + r=arr[-k:]+arr[:-k] + print(" ".join(map(str,r))) +n=int(input()) +arr=list(map(int,input().split())) +k=int(input()) +ra(n,arr,k) From fe4af300f5006f8e5329e21f5fcb6c66d933bed9 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Sun, 17 Nov 2024 12:44:57 +0530 Subject: [PATCH 65/70] Create The_Signal_Shutdown_Puzzle.py --- visa_prep/The_Signal_Shutdown_Puzzle.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 visa_prep/The_Signal_Shutdown_Puzzle.py diff --git a/visa_prep/The_Signal_Shutdown_Puzzle.py b/visa_prep/The_Signal_Shutdown_Puzzle.py new file mode 100644 index 000000000..62d32710a --- /dev/null +++ b/visa_prep/The_Signal_Shutdown_Puzzle.py @@ -0,0 +1,17 @@ +def f(n,m,g): + r=set() + c=set() + for i in range(n): + for j in range(m): + if g[i][j]==0: + r.add(i) + c.add(j) + for i in range(n): + for j in range(m): + if i in r or j in c: + g[i][j]=0 + for r in g: + print(" ".join(map(str,r))) +n,m=map(int,input().split()) +g=[list(map(int,input().split())) for _ in range(n)] +f(n,m,g) From e19f25bc525cf2d15aa03df5f131f73645517b7d Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:07:32 +0530 Subject: [PATCH 66/70] Create Triangle_pattern_3.py --- visa_prep/Triangle_pattern_3.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 visa_prep/Triangle_pattern_3.py diff --git a/visa_prep/Triangle_pattern_3.py b/visa_prep/Triangle_pattern_3.py new file mode 100644 index 000000000..43a0c4f0e --- /dev/null +++ b/visa_prep/Triangle_pattern_3.py @@ -0,0 +1,9 @@ +n=int(input()) +for i in range(1,n+1): + f=''.join(str(x) for x in range(1,i+1)) + s=''.join(str(x) for x in range(i,0,-1)) + sp=' '*(2*(n-i)) + if i==n: + print(f+s) + else: + print(f+sp+s) From 567173036e671f9d2de52183b4b169f50cda552a Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Sun, 17 Nov 2024 19:18:12 +0530 Subject: [PATCH 67/70] Create Bhanu's_Message.py --- visa_prep/Bhanu's_Message.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 visa_prep/Bhanu's_Message.py diff --git a/visa_prep/Bhanu's_Message.py b/visa_prep/Bhanu's_Message.py new file mode 100644 index 000000000..d8ec53dcf --- /dev/null +++ b/visa_prep/Bhanu's_Message.py @@ -0,0 +1,26 @@ +def valid(m): + if len(m)<10 or len(m)>20: + return False + if m[0]=='+': + m=m[1:] + if not all(c.isdigit() or c==' ' for c in m): + return False + n=m.split() + if len(n)==2: + code,ph=n[0],n[1] + if not(len(code)==2 and code.isdigit()): + return False + elif len(n)==1: + ph=n[0] + else: + return False + if len(ph)!=10 or not ph.isdigit(): + return False + s=sum(int(digit) for digit in ph) + return s>0 +if __name__=="__main__": + m=input().strip() + if valid(m): + print("Correct") + else: + print('Incorrect') From 71061ae71f097376990f354eef5104f4690bc871 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Sun, 17 Nov 2024 19:38:04 +0530 Subject: [PATCH 68/70] Create Unique_Order.py --- visa_prep/Unique_Order.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 visa_prep/Unique_Order.py diff --git a/visa_prep/Unique_Order.py b/visa_prep/Unique_Order.py new file mode 100644 index 000000000..f7e31ce3a --- /dev/null +++ b/visa_prep/Unique_Order.py @@ -0,0 +1,11 @@ +def uo(a): + s=set() + r=[] + for n in a: + if n not in s: + r.append(n) + s.add(n) + return r +n=int(input()) +a=list(map(int,input().split())) +print(*uo(a)) From 381a100a7b6127cc955f6316a0f80b032c31f0f7 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Sun, 17 Nov 2024 19:41:29 +0530 Subject: [PATCH 69/70] Create shift_array_1.py --- visa_prep/shift_array_1.py | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 visa_prep/shift_array_1.py diff --git a/visa_prep/shift_array_1.py b/visa_prep/shift_array_1.py new file mode 100644 index 000000000..c61d9db48 --- /dev/null +++ b/visa_prep/shift_array_1.py @@ -0,0 +1,4 @@ +n=int(input()) +A=list(map(int,input().split())) +r=A[1:]+A[:1] +print(" ".join(map(str,r))) From 507ac407d82b4b4aca202c571afe7dbc0fcf2ca0 Mon Sep 17 00:00:00 2001 From: sahasrachiliveri <142159322+sahasrachiliveri@users.noreply.github.com> Date: Sun, 17 Nov 2024 19:58:15 +0530 Subject: [PATCH 70/70] Create Transpose_of_Matrix.py --- visa_prep/Transpose_of_Matrix.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 visa_prep/Transpose_of_Matrix.py diff --git a/visa_prep/Transpose_of_Matrix.py b/visa_prep/Transpose_of_Matrix.py new file mode 100644 index 000000000..895fcceaa --- /dev/null +++ b/visa_prep/Transpose_of_Matrix.py @@ -0,0 +1,9 @@ +n=int(input()) +mat=[list(map(int,input().split())) for _ in range(n)] +def t(mat): + r=len(mat) + c=len(mat[0]) + tr=[[mat[j][i] for j in range(r)] for i in range(c)] + return tr +for r in t(mat): + print(*r)