


'''simple docstring'''



def      _a     (						_lowercase :     list[int]  ):





     '''simple docstring'''






     __UpperCAmelCase     :			Optional[int]  							=      []
     if len(_lowercase  ) == 1:
          return [nums.copy()]
     for _ in range(len(_lowercase  )  ):
          __UpperCAmelCase     :			Any  							=      nums.pop(0  )
          __UpperCAmelCase     :			int  							=      permute(_lowercase  )
          for perm in permutations:
               perm.append(_lowercase  )
          result.extend(_lowercase  )
          nums.append(_lowercase  )
     return result




def      _a     (						_lowercase :     Dict  ):





     '''simple docstring'''






     def backtrack(_lowercase :     Union[str, Any]  ):
          if start == len(_lowercase  ) - 1:
               output.append(nums[:]  )
          else:
               for i in range(_lowercase      , len(_lowercase  )  ):
                    __UpperCAmelCase							,       __UpperCAmelCase     :			int  							=      nums[i], nums[start]
                    backtrack(start + 1  )
                    __UpperCAmelCase							,       __UpperCAmelCase     :			int  							=      nums[i], nums[start]  # backtrack

     __UpperCAmelCase     :			List[Any]  							=      []
     backtrack(0  )
     return output


if __name__ == "__main__":
      import doctest

      # use res to print the data in permute2 function
      __UpperCAmelCase      :Union[str, Any]			    =       permutea([1, 2, 3])
      print(res)
      doctest.testmod()



'''simple docstring'''



import requests

__UpperCAmelCase      :Union[str, Any]			    =       "https://newsapi.org/v1/articles?source=bbc-news&sortBy=top&apiKey="




def      _a     (						_lowercase :     str  ):





     '''simple docstring'''






     __UpperCAmelCase     :			Union[str, Any]  							=      requests.get(_NEWS_API + bbc_news_api_key  ).json()
     # each article in the list is a dict
     for i, article in enumerate(bbc_news_page['''articles''']      , 1  ):
          print(F'{i}.) {article["title"]}'  )


if __name__ == "__main__":
      fetch_bbc_news(bbc_news_api_key="<Your BBC News API key goes here>")