Your question is Find Triplet Sum. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Calsoft's platform services may need to identify three compatible values whose combined score matches a requested target. Given an integer array and a target integer, find three distinct elements whose values sum to the target.
Return the original indices of any valid triplet as a list of three integers. The indices may be returned in any order. If no such triplet exists, return an empty list. An element cannot be reused, although duplicate values at different indices may be selected.
Implement find_triplet(nums, target):
nums, a list of integers, and target, an integer.target, or [] if no solution exists.def find_triplet(nums, target):