Walmart

Anonymous User
8960
Nov 02, 2020
Nov 02, 2020

you are given an integer n and two arrays each of which is a permutation of numbers from 1 to n. your task is to determine the number of unordered triplet (a,b,c) such that relative ordering of(a,b,c) is the same in both the arrays

Constraints

1≤T≤1001 \le T \le 100

1≤n≤1000001 \le n \le 100000

Sample Input1

3

1 2 3

1 2 3

Sample Output

1
Anyone plz give solution.

Comments (4)