From efa3780bec467712e9bf614c75529ea1d46fe2d3 Mon Sep 17 00:00:00 2001 From: ShardulDS Date: Fri, 16 Sep 2022 19:43:24 +0530 Subject: [PATCH 1/5] Challenge 12 Signed-off-by: ShardulDS --- contributors/ShardulDS/ShardulDS.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 contributors/ShardulDS/ShardulDS.md diff --git a/contributors/ShardulDS/ShardulDS.md b/contributors/ShardulDS/ShardulDS.md new file mode 100644 index 000000000..1e9a3c981 --- /dev/null +++ b/contributors/ShardulDS/ShardulDS.md @@ -0,0 +1,6 @@ +--- +name: Shardul Sajnekar +github_user_name: ShardulDS +url_of_github_issue: https://github.com/scaleracademy/scaler-september-open-source-challenge/issues/102#issue-1358537066 +my-favourite-programming-language: Python +--- \ No newline at end of file From bebe4fb2cd9047a87945fcaaf3404e742365edd3 Mon Sep 17 00:00:00 2001 From: ShardulDS Date: Fri, 16 Sep 2022 19:45:10 +0530 Subject: [PATCH 2/5] Challenge 15 Signed-off-by: ShardulDS --- challengers-list.md | 1 + 1 file changed, 1 insertion(+) diff --git a/challengers-list.md b/challengers-list.md index 47394f4f2..2423c6212 100644 --- a/challengers-list.md +++ b/challengers-list.md @@ -1,3 +1,4 @@ # List of challengers 1. [Mrinal](https://github.com/mrinal1224) 2. [Shivay](https://github.com/shivaylamba) +3. [Shardul](https://github.com/ShardulDS) \ No newline at end of file From 7b9ea3433db524b152bf247cf5a91734fc211204 Mon Sep 17 00:00:00 2001 From: ShardulDS Date: Sun, 18 Sep 2022 12:43:09 +0530 Subject: [PATCH 3/5] Challenge 18 Signed-off-by: ShardulDS --- gist-solutions.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 gist-solutions.md diff --git a/gist-solutions.md b/gist-solutions.md new file mode 100644 index 000000000..fe963ab58 --- /dev/null +++ b/gist-solutions.md @@ -0,0 +1,2 @@ +Software Development Topic: https://gist.github.com/ShardulDS/234943fa902a5a2f94a4397db2120a34 +Code snippet: https://gist.github.com/ShardulDS/d2bfa0b9fdd7a21a19cf2a63fa312a47 \ No newline at end of file From a6aed48a9dc75d438b417da64a39d89d8a16426a Mon Sep 17 00:00:00 2001 From: ShardulDS Date: Mon, 19 Sep 2022 18:08:10 +0530 Subject: [PATCH 4/5] Challenge 19 Signed-off-by: ShardulDS --- contributors/ShardulDS/TOH.py | 25 ++++++++++++++++++++++++ contributors/ShardulDS/gist-solutions.md | 4 ++++ gist-solutions.md | 2 -- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 contributors/ShardulDS/TOH.py create mode 100644 contributors/ShardulDS/gist-solutions.md delete mode 100644 gist-solutions.md diff --git a/contributors/ShardulDS/TOH.py b/contributors/ShardulDS/TOH.py new file mode 100644 index 000000000..b63cb8423 --- /dev/null +++ b/contributors/ShardulDS/TOH.py @@ -0,0 +1,25 @@ +"""Tower of Hanoi is a mathematical puzzle where we have three rods +(A, B, and C) and N disks. Initially, all the disks are stacked in decreasing +value of diameter i.e., the smallest disk is placed on the top and they are on +rod A. The objective of the puzzle is to move the entire stack to another rod +(here considered C), obeying the following simple rules: + - Only one disk can be moved at a time. + - Each move consists of taking the upper disk from one of the stacks and + placing it on top of another stack i.e. a disk can only be moved if it + is the uppermost disk on a stack. + - No disk may be placed on top of a smaller disk.""" + + +def TowerOfHanoi(n, from_rod, to_rod, aux_rod, y): + if n == 0: + return y + y = TowerOfHanoi(n - 1, from_rod, aux_rod, to_rod, y) + print("Move disk", n, "from rod", from_rod, "to rod", to_rod) + y += 1 + y = TowerOfHanoi(n - 1, aux_rod, to_rod, from_rod, y) + return y + + +if __name__ == "__main__": + temp = TowerOfHanoi(int(input("No. of disks: ")), "A", "C", "B", 0) + print(f"{temp} moves") diff --git a/contributors/ShardulDS/gist-solutions.md b/contributors/ShardulDS/gist-solutions.md new file mode 100644 index 000000000..8b56eac33 --- /dev/null +++ b/contributors/ShardulDS/gist-solutions.md @@ -0,0 +1,4 @@ +# Challenge 18 + +[Software Development Topic](https://gist.github.com/ShardulDS/234943fa902a5a2f94a4397db2120a34) +[Code snippet](https://gist.github.com/ShardulDS/d2bfa0b9fdd7a21a19cf2a63fa312a47) \ No newline at end of file diff --git a/gist-solutions.md b/gist-solutions.md deleted file mode 100644 index fe963ab58..000000000 --- a/gist-solutions.md +++ /dev/null @@ -1,2 +0,0 @@ -Software Development Topic: https://gist.github.com/ShardulDS/234943fa902a5a2f94a4397db2120a34 -Code snippet: https://gist.github.com/ShardulDS/d2bfa0b9fdd7a21a19cf2a63fa312a47 \ No newline at end of file From 3f385de2136f6a7836be07fd95bb88125fced0e4 Mon Sep 17 00:00:00 2001 From: ShardulDS Date: Thu, 22 Sep 2022 16:30:26 +0530 Subject: [PATCH 5/5] Challenge 22 Signed-off-by: ShardulDS --- contributors/ShardulDS/ShardulDS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contributors/ShardulDS/ShardulDS.md b/contributors/ShardulDS/ShardulDS.md index 1e9a3c981..0a6c414f3 100644 --- a/contributors/ShardulDS/ShardulDS.md +++ b/contributors/ShardulDS/ShardulDS.md @@ -3,4 +3,6 @@ name: Shardul Sajnekar github_user_name: ShardulDS url_of_github_issue: https://github.com/scaleracademy/scaler-september-open-source-challenge/issues/102#issue-1358537066 my-favourite-programming-language: Python +your_hosted_github_pages_link: shardulds.github.io +your_hosted_github_pages_repository_link: https://github.com/ShardulDS/ShardulDS.github.io --- \ No newline at end of file