Algorithm code (backtracking method, dynamic programming, divide and conquer, greedy)