ผิด ๆ ต้องอันนี้
res = [[1]]
for i in range (1, numRows):
begin = [1]
end = [1]
last = res[-1]
middle = [last[j-1] + last[j] for j in range(1, len(last))]
row = [1] + middle + [1]
res.append(row)
return res
Last posted
Total of 3 posts
ผิด ๆ ต้องอันนี้
res = [[1]]
for i in range (1, numRows):
begin = [1]
end = [1]
last = res[-1]
middle = [last[j-1] + last[j] for j in range(1, len(last))]
row = [1] + middle + [1]
res.append(row)
return res
929. Unique Email Addresses
class Solution:
def numUniqueEmails(self, emails: List[str]) -> int:
unique_emails = set()
for email in emails:
local, domain = email.split('@')
local = local.split('+')[0] # Remove the part after '+'
local = local.replace('.', '') # Remove all '.'
unique_email = f"{local}@{domain}"
unique_emails.add(unique_email)
return len(unique_emails)
Be Civil — "Be curious, not judgemental"
All contents are responsibility of its posters.