For the problem solved above, answer the following items:
- What is the running time of the algorithm implemented? Explain your thought process behind the implementation
- Describe in detail the running time breaking down each part of the code implemented into its respective runtimes
- If your code does not meet the minimum runtime requirements, add below a pseudocode of your implementation for the optimal solution. It does not have to follow any specific syntax, it's pseudocode. (If it does meet the minimum requirements, ignore this question)