We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Concatenate/consolidate all algorithms with different implementations
### Feature description

There are lots of algorithms with the same concept but different implementations/methods in different files. All these should be moved into one file

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `dynamic_programming/longest_sub_array.py`
Content:
```
1 """
2 Author  : Yvonne
3 
4 This is a pure Python implementation of Dynamic Programming solution to the
5     longest_sub_array problem.
6 
7 The problem is  :
8 Given an array, to find the longest and continuous sub array and get the max sum of the
9     sub array in the given array.
10 """
11 
12 
13 class SubArray:
14     def __init__(self, arr):
15         # we need a list not a string, so do something to change the type
16         self.array = arr.split(",")
17 
18     def solve_sub_array(self):
19         rear = [int(self.array[0])] * len(self.array)
20         sum_value = [int(self.array[0])] * len(self.array)
21         for i in range(1, len(self.array)):
22             sum_value[i] = max(
23                 int(self.array[i]) + sum_value[i - 1], int(self.array[i])
24             )
25             rear[i] = max(sum_value[i], rear[i - 1])
26         return rear[len(self.array) - 1]
27 
28 
29 if __name__ == "__main__":
30     whole_array = input("please input some numbers:")
31     array = SubArray(whole_array)
32     re = array.solve_sub_array()
33     print(("the results is:", re))
34
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/dynamic_programming/longest_sub_array.py b/dynamic_programming/longest_sub_array.py
deleted file mode 100644
--- a/dynamic_programming/longest_sub_array.py
+++ /dev/null
@@ -1,33 +0,0 @@
-"""
-Author  : Yvonne
-
-This is a pure Python implementation of Dynamic Programming solution to the
-    longest_sub_array problem.
-
-The problem is  :
-Given an array, to find the longest and continuous sub array and get the max sum of the
-    sub array in the given array.
-"""
-
-
-class SubArray:
-    def __init__(self, arr):
-        # we need a list not a string, so do something to change the type
-        self.array = arr.split(",")
-
-    def solve_sub_array(self):
-        rear = [int(self.array[0])] * len(self.array)
-        sum_value = [int(self.array[0])] * len(self.array)
-        for i in range(1, len(self.array)):
-            sum_value[i] = max(
-                int(self.array[i]) + sum_value[i - 1], int(self.array[i])
-            )
-            rear[i] = max(sum_value[i], rear[i - 1])
-        return rear[len(self.array) - 1]
-
-
-if __name__ == "__main__":
-    whole_array = input("please input some numbers:")
-    array = SubArray(whole_array)
-    re = array.solve_sub_array()
-    print(("the results is:", re))

{"golden_diff": "diff --git a/dynamic_programming/longest_sub_array.py b/dynamic_programming/longest_sub_array.py\ndeleted file mode 100644\n--- a/dynamic_programming/longest_sub_array.py\n+++ /dev/null\n@@ -1,33 +0,0 @@\n-\"\"\"\n-Author  : Yvonne\n-\n-This is a pure Python implementation of Dynamic Programming solution to the\n-    longest_sub_array problem.\n-\n-The problem is  :\n-Given an array, to find the longest and continuous sub array and get the max sum of the\n-    sub array in the given array.\n-\"\"\"\n-\n-\n-class SubArray:\n-    def __init__(self, arr):\n-        # we need a list not a string, so do something to change the type\n-        self.array = arr.split(\",\")\n-\n-    def solve_sub_array(self):\n-        rear = [int(self.array[0])] * len(self.array)\n-        sum_value = [int(self.array[0])] * len(self.array)\n-        for i in range(1, len(self.array)):\n-            sum_value[i] = max(\n-                int(self.array[i]) + sum_value[i - 1], int(self.array[i])\n-            )\n-            rear[i] = max(sum_value[i], rear[i - 1])\n-        return rear[len(self.array) - 1]\n-\n-\n-if __name__ == \"__main__\":\n-    whole_array = input(\"please input some numbers:\")\n-    array = SubArray(whole_array)\n-    re = array.solve_sub_array()\n-    print((\"the results is:\", re))\n", "issue": "Concatenate/consolidate all algorithms with different implementations\n### Feature description\n\nThere are lots of algorithms with the same concept but different implementations/methods in different files. All these should be moved into one file\n", "before_files": [{"content": "\"\"\"\nAuthor  : Yvonne\n\nThis is a pure Python implementation of Dynamic Programming solution to the\n    longest_sub_array problem.\n\nThe problem is  :\nGiven an array, to find the longest and continuous sub array and get the max sum of the\n    sub array in the given array.\n\"\"\"\n\n\nclass SubArray:\n    def __init__(self, arr):\n        # we need a list not a string, so do something to change the type\n        self.array = arr.split(\",\")\n\n    def solve_sub_array(self):\n        rear = [int(self.array[0])] * len(self.array)\n        sum_value = [int(self.array[0])] * len(self.array)\n        for i in range(1, len(self.array)):\n            sum_value[i] = max(\n                int(self.array[i]) + sum_value[i - 1], int(self.array[i])\n            )\n            rear[i] = max(sum_value[i], rear[i - 1])\n        return rear[len(self.array) - 1]\n\n\nif __name__ == \"__main__\":\n    whole_array = input(\"please input some numbers:\")\n    array = SubArray(whole_array)\n    re = array.solve_sub_array()\n    print((\"the results is:\", re))\n", "path": "dynamic_programming/longest_sub_array.py"}], "after_files": [{"content": null, "path": "dynamic_programming/longest_sub_array.py"}]}