Skip to content

Conversation

@jayantpatel06
Copy link

Pull Request Template

Description

✅ Step-by-Step Logic
1.Initialize a counter to keep track of how many words start with the given prefix.
2. Iterate through each word in the list.
3. For each word:

  • Check if it is at least as long as the prefix.
  • Compare each character of the word with the corresponding character in the prefix.
  1. If all characters match up to the length of the prefix, it's a valid match.
  2. If the prefix matches, increment the counter.
  3. After checking all words, return the final count.

Complexity:

  1. Time complexity: O(n*m), where n = number of words , m = length of the prefix
  2. Space complexity: O(1)

Put check marks:

Have you made changes in README file ?

  • Added problem & solution under correct topic. ✅
  • Specified Space & Time complexity.✅
  • Specified difficulty level, tag & Note(if any).

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

  • Passed All test cases on LeetCode ✅

Make sure all below guidelines are followed else PR will get Reject:

  • My code follows the style guidelines of this project ✅
  • I have performed a self-review of my own code ✅
  • I have commented my code so that it is easy to understand✅
  • I have made corresponding changes to the documentation✅
  • My changes generate no new warnings✅
  • Any dependent changes have been merged and published in downstream modules✅
@welcome
Copy link

welcome bot commented Jul 19, 2025

I can tell this is your first pull request! Thank you I'm so honored. 🎉🎉🎉 I'll take a look at it ASAP!

@jayantpatel06 jayantpatel06 reopened this Jul 20, 2025
@jayantpatel06 jayantpatel06 closed this by deleting the head repository Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant