'''simple docstring'''

from __future__ import annotations
class 				lowercase_     :







    def __init__(						self							,  UpperCamelCase__					)					->							None:





     """simple docstring"""

     UpperCAmelCase_												=       order

     # a_{0} ... a_{k}
     UpperCAmelCase_												=       [1.0] + [0.0] * order
     # b_{0} ... b_{k}
     UpperCAmelCase_												=       [1.0] + [0.0] * order

     # x[n-1] ... x[n-k]
     UpperCAmelCase_												=       [0.0] * self.order
     # y[n-1] ... y[n-k]
     UpperCAmelCase_												=       [0.0] * self.order







    def 	lowerCamelCase_     (						self							,  UpperCamelCase__							,  UpperCamelCase__					)					->							None:





     """simple docstring"""

     if len(_UpperCamelCase					) < self.order:
      UpperCAmelCase_												=       [1.0, *a_coeffs]

     if len(_UpperCamelCase					) != self.order + 1:
      UpperCAmelCase_												=       (
          F"""Expected a_coeffs to have {self.order + 1} elements """
          F"""for {self.order}-order filter, got {len(_UpperCamelCase					)}"""
      )
      raise ValueError(_UpperCamelCase					)

     if len(_UpperCamelCase					) != self.order + 1:
      UpperCAmelCase_												=       (
          F"""Expected b_coeffs to have {self.order + 1} elements """
          F"""for {self.order}-order filter, got {len(_UpperCamelCase					)}"""
      )
      raise ValueError(_UpperCamelCase					)

     UpperCAmelCase_												=       a_coeffs
     UpperCAmelCase_												=       b_coeffs







    def 	lowerCamelCase_     (						self							,  UpperCamelCase__					)					->							float:





     """simple docstring"""

     UpperCAmelCase_												=       0.0

     # Start at index 1 and do index 0 at the end.
     for i in range(1							,  self.order + 1					):
      result += (
          self.b_coeffs[i] * self.input_history[i - 1]
          - self.a_coeffs[i] * self.output_history[i - 1]
      )

     UpperCAmelCase_												=       (result + self.b_coeffs[0] * sample) / self.a_coeffs[0]

     UpperCAmelCase_												=       self.input_history[:-1]
     UpperCAmelCase_												=       self.output_history[:-1]

     UpperCAmelCase_												=       sample
     UpperCAmelCase_												=       result

     return result




'''simple docstring'''
def 					lowerCamelCase_ ( __UpperCamelCase					:       int		)					->	bool:







     """simple docstring"""
     return str(__UpperCamelCase		) == str(__UpperCamelCase		)[::-1]

def 					lowerCamelCase_ ( __UpperCamelCase					:       int		)					->	int:







     """simple docstring"""
     return int(__UpperCamelCase		) + int(str(__UpperCamelCase		)[::-1]		)

def 					lowerCamelCase_ ( __UpperCamelCase					:       int = 1_0_0_0_0		)					->	int:







     """simple docstring"""
     _A				=							[]
     for num in range(1							,    __UpperCamelCase		):
          _A				=							0
          _A				=							num
          while iterations < 5_0:
               _A				=							sum_reverse(__UpperCamelCase		)
               iterations += 1
               if is_palindrome(__UpperCamelCase		):
                    break
          else:
               lychrel_nums.append(__UpperCamelCase		)
     return len(__UpperCamelCase		)


if __name__ == "__main__":
    print(F'{solution() = }')





