We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Strings
- Find Strings
- Discussions
Find Strings
Find Strings
Sort by
recency
|
70 Discussions
|
Please Login in order to post a comment
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Find Strings Problem Solution
Here is the solution of Find Strings Click Here
I'm starting to detect a clear pattern on HackerRank. One that is disturbing and tends to make me want to use its competitors e.g. GFG, LeetCode. The pattern I'm seeing is your problem statements are vague and imprecise and lack the necessary information to be given a proper chance to solve the much more expansive test cases. It seems the difficulty in the problems I've viewed is not in the problem in of itself, but the poorly explained narrative. You tend to make up some ridiculous narrative like it's a real-world problem, but then go abstract seemingly mid sentence with cryptic mathematical symbols and terms. That's the turn. That's when I know you're problem isn't difficult, but you abstract that fact with technical jargon instead of explaining the output properly and clearly. Take Find String problem for example. It's a trivial task if you properly explain the output of the dictionary, but instead you shroud it in technical mathematical jargon. We're NOT mathematicians we're CODERS!
https://zeroplusfour.com/find-strings/
Here's how I did in all languages Java 8 , C++ , C , Python 3, Python 2.
My code is failed for some test cases, It's in python. n=int(input()) m=[] for i in range(n): s=input() l=[] length=len(s) for i in range(1,length+1): for j in range(length-i+1): l.append(s[j:j+i]) m=m+l
m=set(m) z=sorted(list(m)) for _ in range(int(input())): k=int(input()) if k in range(len(z)+1): print(z[k-1]) else: print("INVALID")