human
Find a triplet that sum to a given value | returns true if there is triplet with sum equal to ' sum ' present in A [ ] . Also , prints the triplet.
Fix the first element as A [ i ].
Find pair in subarray A [ i + 1. . n - 1 ] with sum equal to sum - A [ i ].
If we reach here , then no triplet was found.
Driver program to test above function"
Solution in Python:

=====
Give me a code to find a triplet that sum to a given value and the other steps required?
assistant
#Here is code to find a triplet that sum to a given value and the other steps required.
 def find3Numbers ( A , arr_size , sum ) :
	for i in range ( 0 , arr_size - 1 ) :
		s = set ( )
		curr_sum = sum - A [ i ]
		for j in range ( i + 1 , arr_size ) :
			if ( curr_sum - A [ j ] ) in s :
				print ( " Triplet ▁ is " , A [ i ] , " , ▁ " , A [ j ] , " , ▁ " , curr_sum - A [ j ] )
				return True
			s . add ( A [ j ] )
	return False
A = [ 1 , 4 , 45 , 6 , 10 , 8 ]
sum = 22
arr_size = len ( A )
find3Numbers ( A , arr_size , sum )