diff --git a/python/Dynamic Programming patterns/complex_pattern b/python/Dynamic Programming patterns/complex_pattern deleted file mode 100644 index 68a8e78a..00000000 --- a/python/Dynamic Programming patterns/complex_pattern +++ /dev/null @@ -1,62 +0,0 @@ -# Dynamic program pattern problem: - -# Example for n = 3 -# Output: -# * -# ** * -# ******** -# ** * -# * -# Example for n = 5 -# Output: -# * -# ** -# *** -# **** * -# ************ -# **** * -# *** -# ** -# * - -# Solution in Python -def pattern(n): - # Check if the number is odd and greater than or equal to 3 - if n % 2 == 0 or n < 3: - print("Please enter an odd number") - else: - # Calculate total columns in the widest part of the pattern - row_length = (n * 2) - 1 - # Calculate total columns in the middle solid line - col_length = (n * 2) + 2 - - # ----------------------------- - # Upper top part of the pattern - # ----------------------------- - # Print increasing stars for top-left side (first (n-2) lines) - for row in range(n - 2): - print("*" * (row + 1)) - - # Print the line having gap in between and star at both sides - for row in range(1): - print("*" * (n - 1) + " " * (n + 1) + "*") - - # Print the solid middle line (full stars) - for row in range(1): - print("*" * col_length) - - # Print the line below the solid one (same as above gap line) - for row in range(1): - print("*" * (n - 1) + " " * (n + 1) + "*") - - # ----------------------------- - # Lower bottom part of the pattern - # ----------------------------- - # Print decreasing stars for bottom-left side (mirror of top part) - for row in range(n - 2): - print("*" * (n - row - 2)) - - -# Take input from user -number = int(input("Enter the odd number : ")) -pattern(number) diff --git a/python/Dynamic Programming patterns/complex_pattern.py b/python/Dynamic Programming patterns/complex_pattern.py new file mode 100644 index 00000000..e69de29b diff --git a/python/DynamicProgramming/Climbing_Stairs.py b/python/DynamicProgramming/Climbing_Stairs.py new file mode 100644 index 00000000..e69de29b diff --git a/python/DynamicProgramming/UniquePaths.py b/python/DynamicProgramming/UniquePaths.py new file mode 100644 index 00000000..e69de29b diff --git a/python/Greedy Algorithm/ Question_Non_Overlapping_Intervals.py b/python/Greedy Algorithm/ Question_Non_Overlapping_Intervals.py new file mode 100644 index 00000000..e69de29b diff --git a/python/Greedy Algorithm/ Save_People.py b/python/Greedy Algorithm/ Save_People.py new file mode 100644 index 00000000..e69de29b diff --git a/python/Greedy Algorithm/CoinChange(Greedy).py b/python/Greedy Algorithm/CoinChange(Greedy).py new file mode 100644 index 00000000..e69de29b