Repository navigation
Solution for 14th task - #561
Merged
GouravRusiya30 merged 2 commits intoOct 14, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

this PR adds a LeetCode problem solution with an implementation of the algorithm for the 14th LeetCode problem
Problem 14 : Longest Common Prefix
info about the problem:
difficulty : easy
approach : a for loop with a while loop, including std::string::find to see if there is any work needed to be done to actually find the longest common prefix
feature : an easy to understand, write, yet a fast algorithm for beginners
time complexity : O(n)
space complexity : O(n)
dependencies
no external dependencies required. everything used is in C++ STL
checklist
[x] added problem and solution under correct topic
[x] specified time and space complexity
[x] added test cases
[x] tested locally and passes all test cases