Skip to content

Completed leetcode 205, 290 and 49 - #2315

Open
allurkarsneha wants to merge 1 commit into
super30admin:masterfrom
allurkarsneha:leetcode205-49-290
Open

Completed leetcode 205, 290 and 49#2315
allurkarsneha wants to merge 1 commit into
super30admin:masterfrom
allurkarsneha:leetcode205-49-290

Conversation

@allurkarsneha

Copy link
Copy Markdown

No description provided.

@super30admin

Copy link
Copy Markdown
Owner

Group Anagrams (leetcode205.py)

It appears that you have submitted a solution for a different problem (LeetCode 205 - Isomorphic Strings) instead of the Group Anagrams problem. Please:

  1. Carefully re-read the problem statement for Group Anagrams
  2. Implement a solution that groups strings which are anagrams of each other
  3. Consider using a hash map where the key is either:
    • The sorted version of each string (e.g., "eat" → "aet")
    • A character count tuple (e.g., [1,0,0,...] for 'a')
  4. Test your solution with the provided examples:
    • Input: ["eat","tea","tan","ate","nat","bat"] → Output: [["bat"],["nat","tan"],["ate","eat","tea"]]
    • Input: [""] → Output: [[""]]
    • Input: ["a"] → Output: [["a"]]

VERDICT: NEEDS_IMPROVEMENT


Isomorphic Strings (leetcode290.py)

E wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCore 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) same problem but with words instead of characters. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 2025). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 2025). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIsomorphic (LeetCode 205). The student solved a different problem. The student solved wordPattern (LeetCode 290) instead of isIs

VERDICT: NEEDS_IMPROVEMENT


Word Pattern (leetcode49.py)

It appears you've submitted a solution for a different problem (Group Anagrams - LeetCode 49) instead of the Word Pattern problem (LeetCode 290). Please make sure you're solving the correct problem.

For the Word Pattern problem, here's what you need to do:

  1. Split the string s into individual words using spaces as delimiters
  2. Check if the number of words equals the length of pattern (if not, return false)
  3. Use two dictionaries to maintain the bijection:
    • One mapping from pattern characters to words
    • One mapping from words to pattern characters
  4. Iterate through both simultaneously, checking that each character maps to the correct word and each word maps to the correct character
  5. Return true if all checks pass, false otherwise

Here's a Python solution outline:

class Solution(object):
    def wordPattern(self, pattern, s):
        words = s.split()
        if len(pattern) != len(words):
            return False
        
        p2w = {}  # pattern char -> word
        w2p = {}  # word -> pattern char
        
        for c, w in zip(pattern, words):
            if c not in p2w:
                p2w[c] = w
            elif p2w[c] != w:
                return False
            
            if w not in w2p:
                w2p[w] = c
            elif w2p[w] != c:
                return False
        
        return True

VERDICT: NEEDS_IMPROVEMENT

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