Skip to content

Conversation

@DhruvParashar246
Copy link

No description provided.

@super30admin
Copy link
Owner

  1. Correctness:

    • For "Article Views I": The solution correctly identifies authors who viewed their own articles by comparing 'author_id' and 'viewer_id', then returns the unique sorted IDs. This appears correct.
    • For "Invalid Tweets": The solution incorrectly returns tweets with content length > 15 when it should return those with length <= 15 (assuming standard invalid tweet definition). This is incorrect.
  2. Time Complexity:

    • Both solutions use pandas filtering operations which are O(n) where n is the number of rows in the DataFrame.
    • The sorting operation in "Article Views I" adds O(m log m) where m is the number of matching rows.
  3. Space Complexity:

    • Both solutions create new DataFrames (df) which requires O(k) space where k is the number of matching rows.
    • The space usage is reasonable for these operations.
  4. Code Quality:

    • The code is generally clean and follows pandas best practices.
    • Variable names are clear (df, views, tweets).
    • Could benefit from comments explaining the logic, especially for "Invalid Tweets" where the requirement might be ambiguous.
  5. Efficiency:

    • "Article Views I" could potentially combine the drop_duplicates and sort operations into a single sort if performance is critical.
    • "Invalid Tweets" needs to correct the filtering condition (should be <= 15 instead of > 15).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants