'''simple docstring'''




from __future__ import annotations

def      UpperCamelCase_							( _UpperCAmelCase  :				list[int]      ,     _UpperCAmelCase  :				int   )   ->   list[int]:


       """simple docstring"""







       _UpperCAmelCase					:  dict[int, int]											=   {}
       for index, val in enumerate(_UpperCAmelCase   ):
              _UpperCAmelCase					:  int											=   target - val
              if compl in chk_map:
                     return [chk_map[compl], index]
              _UpperCAmelCase					:  int											=   index
       return []


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  print(F'{two_sum([2, 7, 11, 15], 9) = }')


'''simple docstring'''




from itertools import compress, repeat
from math import ceil, sqrt

def      UpperCamelCase_							( _UpperCAmelCase  :				int   )   ->   list[int]:


       """simple docstring"""







       if num <= 2:
              return []
       if num == 3:
              return [2]

       # Odd sieve for numbers in range [3, num - 1]
       _UpperCAmelCase					:  Optional[int]											=   bytearray(b"\x01"   ) * ((num >> 1) - 1)

       for i in range(3      ,     int(sqrt(_UpperCAmelCase   )   ) + 1      ,     2   ):
              if sieve[(i >> 1) - 1]:
                     _UpperCAmelCase					:  List[Any]											=   i**2
                     _UpperCAmelCase					:  Optional[int]											=   repeat(
                         0      ,     ceil((num - i_squared) / (i << 1)   )   )

       return [2] + list(compress(range(3      ,     _UpperCAmelCase      ,     2   )      ,     _UpperCAmelCase   )   )


if __name__ == "__main__":
  import doctest

  doctest.testmod()

