Please can you tell the time complexity of below code.
while i<len(s) and s[i] != ' ':
while j>=0 and s[j] != ' ':
return y[::-1] + x
else: return False
Instructions for code:
- Define a function with the name
email_functhat takes a
strargument and extracts out and returns the first email id. If there is no email id present return
- Return only if there is valid email id. An email id is valid if at least one
@is present in it and no blank spaces. Else, you can return the boolean False. We are keeping the requirement for a valid email simple, requiring only one ‘@’ in it. We do not want you to write an exhaustive check for valid email here.