human
Split the array elements into strictly increasing and decreasing sequence | Function to print both the arrays.
Store both arrays.
Used for hashing.
Iterate for every element.
Increase the count.
If first occurrence.
If second occurrence.
If occurs more than 2 times.
Sort in increasing order.
Print the increasing array.
Sort in reverse order.
Print the decreasing array.
Driver code"
Solution in Python:
assistant
#Here is code to split the array elements into strictly increasing and decreasing sequence and the other steps required.
 def PrintBothArrays ( a , n ) :
	v1 , v2 = [ ] , [ ] ;
	mpp = dict . fromkeys ( a , 0 ) ;
	for i in range ( n ) :
		mpp [ a [ i ] ] += 1 ;
		if ( mpp [ a [ i ] ] == 1 ) :
			v1 . append ( a [ i ] ) ;
		elif ( mpp [ a [ i ] ] == 2 ) :
			v2 . append ( a [ i ] ) ;
		else :
			print ( " Not ▁ possible " ) ;
			return ;
	v1 . sort ( ) ;
	print ( " Strictly ▁ increasing ▁ array ▁ is : " ) ;
	for it in v1 :
		print ( it , end = " ▁ " ) ;
	v2 . sort ( reverse = True ) ;
	print ( " Strictly decreasing array is : " ) ;
	for it in v2 :
		print ( it , end = " ▁ " )
if __name__ == " _ _ main _ _ " :
	a = [ 7 , 2 , 7 , 3 , 3 , 1 , 4 ] ;
	n = len ( a ) ;
	PrintBothArrays ( a , n ) ;