human
Minimum number of integers required such that each Segment contains at least one of them | Function to compute minimum number of points which cover all segments.
Sort the list of tuples by their second element ..
To store the solution.
Iterate over all the segments.
Get the start point of next segment.
Loop over all those segments whose start point is less than the end point of current segment.
Print the possibles values of M.
Driver Code.
Starting points of segments.
Ending points of segments.
Insert ranges in points [ ].
Function Call"
Solution in Python:

Write me a code to minimum number of integers required such that each Segment contains at least one of them and the other steps required?
assistant
#Here is code to minimum number of integers required such that each Segment contains at least one of them and the other steps required.
 def minPoints ( points ) :
	points . sort ( key = lambda x : x [ 1 ] )
	coordinates = [ ]
	i = 0
	while i < n :
		seg = points [ i ] [ 1 ]
		coordinates . append ( seg )
		p = i + 1
		if p >= n :
			break
		arrived = points [ p ] [ 0 ]
		while seg >= arrived :
			p += 1
			if p >= n :
				break
			arrived = points [ p ] [ 0 ]
		i = p
	for point in coordinates :
		print ( point , end = " ▁ " )
n = 4
start = [ 4 , 1 , 2 , 5 ]
end = [ 7 , 3 , 5 , 6 ]
points = [ ]
for i in range ( n ) :
	tu = ( start [ i ] , end [ i ] )
	points . append ( tu )
minPoints ( points )