Easy Pandas solution using REGEX | Beats 87.84%
IntuitionUsing a regular expression to filter the rows with appropriate string values in the email column.ApproachComplexity

Time complexity:
345ms


Space com
# Intuition
Using a regular expression to filter the rows with appropriate string values in the email column.

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
345ms

- Space complexity:
61.18MB

# Code
```pythondata []
import pandas as pd

def find_valid_emails(users: pd.DataFrame) -> pd.DataFrame:
    users = users.sort_values(by = 'user_id', ascending = True)
    result = users[users['email'].str.contains(r'^[a-zA-Z0-9_]+@[a-zA-Z]+\.com
```)]
    # ^[a-zA-Z0-9_]+: This part ensures the email starts with alphanumeric characters or underscores.
    # @: There should be exactly one @ symbol.
    # ([a-zA-Z]+): After the @ symbol, we ensure only alphabetic characters are allowed in the domain part.
    # \.com$: Ensures the email ends with .com.
    return result
```
['Pandas']