






"""simple docstring"""
def 			__UpperCamelCase	(		snake_case__					):
	A_		:						Any	    =   [0] * len(snake_case__					)

	for i in range(1   ,   len(snake_case__					)					):
		# use last results for better performance - dynamic programming
		A_		:						List[str]	    =   prefix_result[i - 1]
		while j > 0 and input_string[i] != input_string[j]:
			A_		:						Dict	    =   prefix_result[j - 1]

		if input_string[i] == input_string[j]:
			j += 1
		A_		:						Optional[Any]	    =   j

	return prefix_result






def 			__UpperCamelCase	(		snake_case__					):
	return max(prefix_function(snake_case__					)					)


if __name__ == "__main__":
							import doctest

							doctest.testmod()









"""simple docstring"""
import sys
import webbrowser

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
							print("Googling.....")
							_lowerCAmelCase         =							"https://www.google.com/search?q=" + " ".join(sys.argv[1:])
							_lowerCAmelCase         =							requests.get(url, headers={"UserAgent": UserAgent().random})
							# res.raise_for_status()
							with open("project1a.html", "wb") as out_file:  # only for knowing the class
														for data in res.iter_content(10_000):
																					out_file.write(data)
							_lowerCAmelCase         =							BeautifulSoup(res.text, "html.parser")
							_lowerCAmelCase         =							list(soup.select(".eZt8xd"))[:5]

							print(len(links))
							for link in links:
														if link.text == "Maps":
																					webbrowser.open(link.get("href"))
														else:
																					webbrowser.open(F'https://google.com{link.get("href")}')

