


'''simple docstring'''






from __future__ import annotations

import math






def 	_A				(lowerCAmelCase__  :int				,						lowerCAmelCase__  :int				,						lowerCAmelCase__  :bool				,						lowerCAmelCase__  :list[int]				,						lowerCAmelCase__  :float		)   ->  int:




     '''simple docstring'''



     if depth < 0:
          raise ValueError('Depth cannot be less than 0'		)

     if not scores:
          raise ValueError('Scores cannot be empty'		)

     if depth == height:
          return scores[node_index]

     return (
         max(
             minimax(depth + 1				,						node_index * 2				,						lowerCAmelCase__				,						lowerCAmelCase__				,						lowerCAmelCase__		)				,						minimax(depth + 1				,						node_index * 2 + 1				,						lowerCAmelCase__				,						lowerCAmelCase__				,						lowerCAmelCase__		)				,						)
         if is_max
         else min(
             minimax(depth + 1				,						node_index * 2				,						lowerCAmelCase__				,						lowerCAmelCase__				,						lowerCAmelCase__		)				,						minimax(depth + 1				,						node_index * 2 + 1				,						lowerCAmelCase__				,						lowerCAmelCase__				,						lowerCAmelCase__		)				,						)
     )






def 	_A				()   ->  None:




     '''simple docstring'''



     _a			      =							[90, 23, 6, 33, 21, 65, 1_23, 3_44_23]
     _a			      =							math.log(len(lowerCAmelCase__		)				,						2		)
     print(f'Optimal value : {minimax(0				,						0				,						lowerCAmelCase__				,						lowerCAmelCase__				,						lowerCAmelCase__		)}'		)


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       main()





'''simple docstring'''






from typing import Any






def 	_A				(lowerCAmelCase__  :list		)   ->  list[Any]:




     '''simple docstring'''



     if not input_list:
          return []
     _a			      =							[input_list.count(lowerCAmelCase__		) for value in input_list]
     _a			      =							max(lowerCAmelCase__		)  # Gets the maximum count in the input list.
     # Gets values of modes
     return sorted({input_list[i] for i, value in enumerate(lowerCAmelCase__		) if value == y}		)


if __name__ == "__main__":
 import doctest

 doctest.testmod()

