






"""simple docstring"""




def 			lowerCAmelCase__     (     UpperCamelCase__				):



  '''simple docstring'''
  _a  :       int             =	[0] * len(__a				)

  for i in range(1     ,   len(__a				)				):
    # use last results for better performance - dynamic programming
    _a  :       int             =	prefix_result[i - 1]
    while j > 0 and input_string[i] != input_string[j]:
      _a  :       Optional[Any]             =	prefix_result[j - 1]

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

  return prefix_result

def 			lowerCAmelCase__     (     UpperCamelCase__				):



  '''simple docstring'''
  return max(prefix_function(__a				)				)


if __name__ == "__main__":
 import doctest

 doctest.testmod()








from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
					A    :					List[str] =      input('''Enter image url: ''').strip()
					print(F'''Downloading image from {url} ...''')
					A    :					Any =      BeautifulSoup(requests.get(url).content, '''html.parser''')
					# The image URL is in the content field of the first meta tag with property og:image
					A    :					List[Any] =      soup.find('''meta''', {'''property''': '''og:image'''})['''content''']
					A    :					Dict =      requests.get(image_url).content
					A    :					Tuple =      F'''{datetime.now():%Y-%m-%d_%H:%M:%S}.jpg'''
					with open(file_name, '''wb''') as fp:
										fp.write(image_data)
					print(F'''Done. Image saved to disk as {file_name}.''')



