PS: I came across this problem on gfg, but then realised that their solution isWrong. It fails on the following case: A = {0, 0, 0}, B = {1, 2, 1} Output should be 2, but their code is giving 3. Edit: there can be two variation of this problem: 1st — When K is a p...