Extract Cards

Asked at Infosys · Coding Questions · Difficulty: Hard · Last asked Jul 15, 2026

You are given some numbered cards which are a permutation of length `n`, you have to extract each card in increasing order i.e. `1,2,...n`. You are allowed to do 3 types of operations any number of times.

Loading the problem…