Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create shortEncodingofWords.py #64

Merged
merged 1 commit into from
Oct 11, 2024
Merged

Create shortEncodingofWords.py #64

merged 1 commit into from
Oct 11, 2024

Conversation

rrayhka
Copy link
Contributor

@rrayhka rrayhka commented Oct 11, 2024

Pull Request Template

Description

The goal is to find the length of the shortest reference string that can encode a given list of words using a specific encoding scheme.

Fixes #15

Type of Change

Please select the option that best describes your change:

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

The solution has been tested with multiple test cases, including the example provided in the problem description and additional cases to ensure correctness and performance.

Test Cases:

  • Test A: Example case from the problem.
  • Test B: Edge case with words that can form multiple encodings.
  • Test C: Words of the same length.
  • Test D: Large list of unique and overlapping words.

Test Configuration:

  • Operating System: Windows 11
  • Python Version: 3.11.9

Checklist:

  • I have read the contribution guidelines for this project
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Information

This Python implementation provides a clean and efficient solution, using built-in Python features such as string manipulation and dictionaries. The time complexity of this solution is O(n * m), where n is the number of words and m is the maximum length of a word, making it suitable for the given constraints.

@arya2004 arya2004 merged commit a687d6c into arya2004:main Oct 11, 2024
1 check passed
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.

Contribute Solution for LeetCode October Day 15
2 participants