Описание задачи: https://github.com/CrazySquirrel/Outt...
Recursion: O(T + P) 2 ^ (T + P/2) | O(T + P) 2 ^ (T + P/2) - https://github.com/CrazySquirrel/Outt...
Dynamic Programming Top-Down: O(TP) | O(TP) - https://github.com/CrazySquirrel/Outt...
Dynamic Programming Bottom-Up: O(TP) | O(TP) - https://github.com/CrazySquirrel/Outt...