





'''simple docstring'''


# A Bipartite Graph is a graph whose vertices can be divided into two independent sets,
# U and V such that every edge (u, v) either connects a vertex from U to V or a vertex
# from V to U. In other words, for every edge (u, v), either u belongs to U and v to V,
# or u belongs to V and v to U. We can also say that there is no edge that connects
# vertices of same set.
def 							UpperCAmelCase_  (						__lowerCamelCase : Union[str, Any]			):
   lowercase_      :List[Any]         =			[False] * len(__lowerCamelCase			)
   lowercase_      :Dict         =			[-1] * len(__lowerCamelCase			)

   def dfs(__lowerCamelCase : Optional[int]     ,__lowerCamelCase : Dict			):
      lowercase_      :Any         =			True
      lowercase_      :Union[str, Any]         =			c
      for u in graph[v]:
         if not visited[u]:
            dfs(__lowerCamelCase     ,1 - c			)

   for i in range(len(__lowerCamelCase			)			):
      if not visited[i]:
         dfs(__lowerCamelCase     ,0			)

   for i in range(len(__lowerCamelCase			)			):
      for j in graph[i]:
         if color[i] == color[j]:
            return False

   return True


# Adjacency list of graph
lowerCAmelCase :					int 							={0: [1, 3], 1: [0, 2], 2: [1, 3], 3: [0, 2], 4: []}


print(check_bipartite_dfs(graph))









'''simple docstring'''


def 							UpperCAmelCase_  (						__lowerCamelCase : str     ,__lowerCamelCase : str			):
   lowercase_      :Optional[Any]         =			len(__lowerCamelCase			)
   lowercase_      :List[Any]         =			[]
   for i in range(len(__lowerCamelCase			) - pat_len + 1			):
      lowercase_      :Dict         =			True
      for j in range(__lowerCamelCase			):
         if s[i + j] != pattern[j]:
            lowercase_      :int         =			False
            break
      if match_found:
         position.append(__lowerCamelCase			)
   return position


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


