You are given an integer n and two arrays each of which is a permutations of number from 1 to n youbhave to determine the number of unordered tripplets (a, b,
c.Such that the relative ordering of abc is same in both the ways
Answers
Answered by
7
Input : A[] = {2, 2, 3, 3}
Output : 2 1 3 4
Explanation:
To make it a permutation of 1 to 4, 1 and 4 are
missing from the array. So replace 2, 3 with
1 and 4.
Input : A[] = {1, 3, 2}
Output : 1 3 2
Input : A[] = {10, 1, 2}
Output : 3 1 2
I hope this will help you
if not then comment me
Output : 2 1 3 4
Explanation:
To make it a permutation of 1 to 4, 1 and 4 are
missing from the array. So replace 2, 3 with
1 and 4.
Input : A[] = {1, 3, 2}
Output : 1 3 2
Input : A[] = {10, 1, 2}
Output : 3 1 2
I hope this will help you
if not then comment me
Similar questions
Chemistry,
7 months ago
History,
7 months ago
Computer Science,
1 year ago
English,
1 year ago
English,
1 year ago
Social Sciences,
1 year ago