Company: Publicius sapienet_5nov
Difficulty: medium
Distinct Triplet Selection Problem Description Implement a function to select three workers for a construction project according to specific criteria: Workers and their capacities are represented as an array of integers. You must select a triplet (3 workers) from the capacity array. At least 2 of the selected workers must be adjacent in the array. The product of the capacities of the selected workers must equal a specified capacity, desiredCapacity . The number of ways to pick distinct triplets. Two triplets are distinct if the index of at least one chosen worker differs in the two triplets. For example, there are n = 5 workers with capacity levels of capacity = [1, 3, 5, 3, 5] . The desiredCapacity = 15 . The following 4 triplets satisfy the conditions. The array uses 0-based indexing. i) 1, 3, 5 -> capacity[0], capacity[1], capacity[2] ii) 1, 5, 3 -> capacity[0], capacity[2], capacity[3] iii) 1, 3, 5 -> capacity[0], capacity[3], capacity[2] iv) 1, 3, 5 -> capacity[0], capacity[3], ca