Question: Code this triple sum with User input pls. JOption java language Given 3 arrays a, b, c of different sizes, find the number of distinct
Code this triple sum with User input pls. JOption java language


Given 3 arrays a, b, c of different sizes, find the number of distinct triplets (p, q, r) where pis an element of a, written as pea, q E b, and rec, satisfying the criteria: p r. For example, given a = [3, 5, 7], b = [3,6], and [4, 6, 9), we find four distinct triplets: (3, 6, 4), (3, 6, 6), (5, 6, 4), (5,6,6). C= Function Description Complete the triplets function in the editor below. It must return the number of distinct triplets that can be formed from the given arrays. triplets has the following parameter(s): a, b, c: three arrays of integers. Input Format The first line contains 3 integers lena, lenb, and lenc, the sizes of the three arrays. The next 3 lines contain space-separated integers numbering lena, lenb, and lenc Constraints 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
