

import doctest
from collections import deque

import numpy as np





class 					__lowerCAmelCase	:




  def __init__(							self   )    ->					None:
        '''simple docstring'''






        _lowercase      			=[2, 1, 2, -1]
        _lowercase      			=[1, 2, 3, 4]




  def     A__	(							self   )    ->					list[float]:
        '''simple docstring'''






        _lowercase      			=len(self.first_signal   )
        _lowercase      			=len(self.second_signal   )

        _lowercase      			=max(_UpperCAmelCase				,  _UpperCAmelCase   )

        # create a zero matrix of max_length x max_length
        _lowercase      			=[[0] * max_length for i in range(_UpperCAmelCase   )]

        # fills the smaller signal with zeros to make both signals of same length
        if length_first_signal < length_second_signal:
              self.first_signal += [0] * (max_length - length_first_signal)
        elif length_first_signal > length_second_signal:
              self.second_signal += [0] * (max_length - length_second_signal)
        for i in range(_UpperCAmelCase   ):
              _lowercase      			=deque(self.second_signal   )
              rotated_signal.rotate(_UpperCAmelCase   )
              for j, item in enumerate(_UpperCAmelCase   ):
                    matrix[i][j] += item

        # multiply the matrix with the first signal
        _lowercase      			=np.matmul(np.transpose(_UpperCAmelCase   )				,  np.transpose(self.first_signal   )   )

        # rounding-off to two decimal places
        return [round(_UpperCAmelCase				,  2   ) for i in final_signal]


if __name__ == "__main__":
  doctest.testmod()






from __future__ import annotations






def 					UpperCamelCase   (      __magic_name__	:				list[int]	)  ->    list[int]:  # This function is recursive
		"""simple docstring"""




		lowercase__	     =						len(__magic_name__	)
		# If the array contains only one element, we return it (it's the stop condition of
		# recursion)
		if array_length <= 1:
				return array
				# Else
		lowercase__	     =						array[0]
		lowercase__	     =						False
		lowercase__	     =						1
		lowercase__	     =						[]
		while not is_found and i < array_length:
				if array[i] < pivot:
						lowercase__	     =						True
						lowercase__	     =						[element for element in array[i:] if element >= array[i]]
						lowercase__	     =						longest_subsequence(__magic_name__	)
						if len(__magic_name__	) > len(__magic_name__	):
								lowercase__	     =						temp_array
				else:
						i += 1

		lowercase__	     =						[element for element in array[1:] if element >= pivot]
		lowercase__	     =						[pivot, *longest_subsequence(__magic_name__	)]
		if len(__magic_name__	) > len(__magic_name__	):
				return temp_array
		else:
				return longest_subseq


if __name__ == "__main__":
	import doctest

	doctest.testmod()

