Maximum Domino Removals
Amazon Games has introduced an exciting new game that revolves around dominoes! π² The game consists of n dominoes, each having a distinct size represented by an array tiles.
In this game, the "order" of the dominoes is defined as the length of the longest strictly increasing subsequence (LIS) formed by their sizes.
Additionally, there is another array removalOrder, which contains integers ranging from 0 to n-1. These integers indicate the positions of dominoes that can be removed one by one in the specified sequence.
Your objective is to determine the maximum number of removals that can be performed while ensuring that the order (LIS) of the remaining dominoes remains at least a given threshold minOrder.
Parameters -
Return -
The function should return a single integer, which represents the maximum number of removals possible while keeping the longest strictly increasing subsequence at least minOrder.
1Example 1
remove. After each removal, the length of the LIS of the remaining dominoes should be at least min_order. The task is to find out the maximum number of such removals possible.