Note: this article is published on 07/20/2024.
I came from science, I have never had a chance to learn or play a game such as an algorithm in my student career. Most algorithm problems I met are in interviews. In my view, these kinds of tricks are just boby level games, but if you did not have related training previously, you might not get the solution immediately. So, I will open a topic, or series, to record the algorithm questions I met or I played previously (10/03/2021, from my first algorithm article).
This series will include,
I will add more on this topic probably from my notes or practice code.
A - Introduction
This is the structure of this article,
- A - Introduction
- B - Question
- C - Main
- D - Order (2) Solution
- E - Order (1) Solution
B - Question
The question given is below:
C - Main Program
Main:
D - Order (2) Solution
Order 2:
This algorithm is working, but with Order (2) solution: measured from
![]()
E - Order (1) Solution
Order 1:
Here, we use one dimension calculation to finish the task, it is a one order calculation:
![]()
References