Added minimum waiting time problem solution using greedy algorithm
diff --git a/DIRECTORY.md b/DIRECTORY.md
index 681d252b232d..297fb9f5defa 100644
--- a/DIRECTORY.md
+++ b/DIRECTORY.md
@@ -449,6 +449,7 @@
   * [Fractional Knapsack](greedy_methods/fractional_knapsack.py)
   * [Fractional Knapsack 2](greedy_methods/fractional_knapsack_2.py)
   * [Optimal Merge Pattern](greedy_methods/optimal_merge_pattern.py)
+  * [Minimum Waiting Time ](greedy_methods/minimum_waiting_time.py)
 
 ## Hashes
   * [Adler32](hashes/adler32.py)
diff --git a/greedy_methods/minimum_waiting_time.py b/greedy_methods/minimum_waiting_time.py
new file mode 100644
index 000000000000..aaae8cf8f720
--- /dev/null
+++ b/greedy_methods/minimum_waiting_time.py
@@ -0,0 +1,48 @@
+"""
+Calculate the minimum waiting time using a greedy algorithm.
+reference: https://www.youtube.com/watch?v=Sf3eiO12eJs
+
+For doctests run following command:
+python -m doctest -v minimum_waiting_time.py
+
+The minimum_waiting_time function uses a greedy algorithm to calculate the minimum
+time for queries to complete. It sorts the list in non-decreasing order, calculates
+the waiting time for each query by multiplying its position in the list with the
+sum of all remaining query times, and returns the total waiting time. A doctest
+ensures that the function produces the correct output.
+"""
+
+
+def minimum_waiting_time(queries: list[int]) -> int:
+    """
+    This function takes a list of query times and returns the minimum waiting time
+    for all queries to be completed.
+
+    Args:
+        queries: A list of queries measured in picoseconds
+
+    Returns:
+        total_waiting_time: Minimum waiting time measured in picoseconds
+
+    Examples:
+    >>> minimum_waiting_time([3, 2, 1, 2, 6])
+    17
+    >>> minimum_waiting_time([3, 2, 1])
+    4
+    >>> minimum_waiting_time([1, 2, 3, 4])
+    10
+    >>> minimum_waiting_time([5, 5, 5, 5])
+    30
+    >>> minimum_waiting_time([])
+    0
+    """
+    n = len(queries)
+    if n in (0, 1):
+        return 0
+    return sum(query * (n - i - 1) for i, query in enumerate(sorted(queries)))
+
+
+if __name__ == "__main__":
+    import doctest
+
+    doctest.testmod()

### Describe your change:



* [x] Add an algorithm?
* [ ] Fix a bug or typo in an existing algorithm?
* [ ] Documentation change?

### Checklist:
* [x] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Python/blob/master/CONTRIBUTING.md).
* [x] This pull request is all my own work -- I have not plagiarized.
* [x] I know that pull requests will not be merged if they fail the automated tests.
* [x] This PR only changes one algorithm file.  To ease review, please open separate PRs for separate algorithms.
* [x] All new Python files are placed inside an existing directory.
* [x] All filenames are in all lowercase characters with no spaces or dashes.
* [x] All functions and variable names follow Python naming conventions.
* [x] All function parameters and return values are annotated with Python [type hints](https://docs.python.org/3/library/typing.html).
* [x] All functions have [doctests](https://docs.python.org/3/library/doctest.html) that pass the automated testing.
* [x] All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
* [x] If this pull request resolves one or more open issues then the commit message contains `Fixes: #{$ISSUE_NO}`.
