From 4b51922942b554351aeafe405c49fde2b3d43e9d Mon Sep 17 00:00:00 2001 From: pradeepthiyyagura Date: Thu, 16 Feb 2023 20:47:45 -0700 Subject: [PATCH 1/4] Add environment.yml Earlier the repository did not specify how to get number_of_ways.py to work well --- environment.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 environment.yml diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..60d1683 --- /dev/null +++ b/environment.yml @@ -0,0 +1,7 @@ +name: cs1971ec2 +channels: + - defaults +dependencies: + - python=3.9 + - tqdm +prefix: /Users/tpradeep/miniconda3/envs/cs1971ec2 From 3e4a2e7f30ddd2c5dcee60b629eee122a65f564e Mon Sep 17 00:00:00 2001 From: pradeepthiyyagura Date: Thu, 16 Feb 2023 21:07:15 -0700 Subject: [PATCH 2/4] Added a line of code --- rise.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 rise.py diff --git a/rise.py b/rise.py new file mode 100644 index 0000000..db183e5 --- /dev/null +++ b/rise.py @@ -0,0 +1,2 @@ +print("Rise & SHine") +print("lets get it started) \ No newline at end of file From 02690cd7a7201904bf7c7af38a372e1d40b31423 Mon Sep 17 00:00:00 2001 From: pradeepthiyyagura Date: Thu, 16 Feb 2023 21:19:58 -0700 Subject: [PATCH 3/4] Fixed Error --- rise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rise.py b/rise.py index db183e5..ca682bc 100644 --- a/rise.py +++ b/rise.py @@ -1,2 +1,2 @@ print("Rise & SHine") -print("lets get it started) \ No newline at end of file +print("lets get it started") \ No newline at end of file From 54c5f4125c53d6ac85be4ad50850bd786d255bd7 Mon Sep 17 00:00:00 2001 From: pradeepthiyyagura Date: Thu, 16 Feb 2023 22:12:09 -0700 Subject: [PATCH 4/4] Fix initialization of paths Paths shoud have been a list of one list element, rather than a lis of one int element. --- number_of_ways.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/number_of_ways.py b/number_of_ways.py index bebe306..fcd47be 100644 --- a/number_of_ways.py +++ b/number_of_ways.py @@ -16,7 +16,7 @@ def numberOfWays(startPos: int, endPos: int, k: int) -> int: perform exactly k steps. """ # start with path of length 1 - paths = [startPos] + paths = [[startPos]] # loop k times for i in tqdm(range(k)):