

"""simple docstring"""

from collections import defaultdict

from graphs.minimum_spanning_tree_prims import prisms_algorithm as mst



def       SCREAMING_SNAKE_CASE							( )			->						List[Any]:
 lowerCAmelCase__			,						lowerCAmelCase__   :				List[Any] 			=				9, 1_4  # noqa: F841
 lowerCAmelCase__   :				Union[str, Any] 			=				[
     [0, 1, 4],
     [0, 7, 8],
     [1, 2, 8],
     [7, 8, 7],
     [7, 6, 1],
     [2, 8, 2],
     [8, 6, 6],
     [2, 3, 7],
     [2, 5, 4],
     [6, 5, 2],
     [3, 5, 1_4],
     [3, 4, 9],
     [5, 4, 1_0],
     [1, 7, 1_1],
 ]

 lowerCAmelCase__   :				Any 			=				defaultdict(lowercase__   )
 for nodea, nodea, cost in edges:
  adjancency[nodea].append([nodea, cost]   )
  adjancency[nodea].append([nodea, cost]   )

 lowerCAmelCase__   :				Optional[Any] 			=				mst(lowercase__   )

 lowerCAmelCase__   :				Optional[Any] 			=				[
     [7, 6, 1],
     [2, 8, 2],
     [6, 5, 2],
     [0, 1, 4],
     [2, 5, 4],
     [2, 3, 7],
     [0, 7, 8],
     [3, 4, 9],
 ]

 for answer in expected:
  lowerCAmelCase__   :				Optional[Any] 			=				tuple(answer[:2]   )
  lowerCAmelCase__   :				List[Any] 			=				tuple(edge[::-1]   )
  assert edge in result or reverse in result









"""simple docstring"""

def       SCREAMING_SNAKE_CASE							( lowercase__					,					lowercase__   )			->						list:
 lowerCAmelCase__   :				List[str] 			=				len(lowercase__   )
 lowerCAmelCase__   :				Dict 			=				[]
 for i in range(len(lowercase__   ) - pat_len + 1   ):
  lowerCAmelCase__   :				Union[str, Any] 			=				True
  for j in range(lowercase__   ):
   if s[i + j] != pattern[j]:
    lowerCAmelCase__   :				int 			=				False
    break
  if match_found:
   position.append(lowercase__   )
 return position


if __name__ == "__main__":
    assert naive_pattern_search("""ABCDEFG""", """DE""") == [3]
    print(naive_pattern_search("""ABAAABCDBBABCDDEBCABC""", """ABC"""))






