All Questions
10 questions
5
votes
1
answer
596
views
Lingo (word-game) guessing strategy
My friend and I are kind of noobs in Python and are looking for ways to improve. We thought it would be cool if we could get some feedback on the following code. It is for a game named "Lingo&...
1
vote
1
answer
545
views
Finding longest word in a sentence
A problem from Coderbyte. Find the longest word in a sentence after removing the punctuations and if two or more words are of same length return the first word
Below is my solution:
...
1
vote
1
answer
5k
views
String Rotation
I have solved a previous year question of 2018 codevita (link) in Python.
Problem Description:
Rotate a given String in the specified direction by specified magnitude.
After each rotation make a ...
4
votes
1
answer
267
views
Culling strings from a list that are substrings of other list elements
I'm bothered by my answer to this SO question.
I'm pretty sure it's more efficient than the sort-and-cull implementations, but I'm having trouble expressing that in a way that I trust.
Also, it's ...
2
votes
1
answer
86
views
Length of the longest common sub sequence bottom up
Could I get some feedback on this code? I included a test case as well.
This code computes the longest common sub sequence given paired data, it was not part of any challenge I just did it to learn ...
2
votes
1
answer
49
views
Determine if an array of arrays of characters can be concatenated in order, into a substring of haystack
Algorithm: Determine if an array of arrays of characters can be
concatenated in order, into a substring of haystack.
Example:
...
5
votes
1
answer
2k
views
Code to implement the Jaro similarity for fuzzy matching strings
Problem
This code is meant to solve the problem in this software engineering question. To summarize the issue: given a set of strings that are sort of similar, but not similar enough to use regex upon,...
6
votes
4
answers
16k
views
Longest substring in alphabetical order
The code is meant to find the longest substring that is in alphabetical order.
I would like to know if I can do it more efficiently than I have done here. I am in my first week of my first ...
7
votes
2
answers
2k
views
Counting the number of continuous palindromic substrings
Given a string of lowercase ASCII characters, find all distinct continuous palindromic sub-strings of it.
Here is my code:
...
2
votes
3
answers
2k
views
Longest common subsequence (LCS) for multiple strings
How would you improve this code? Particularly the check and check_all functions?
The time complexity of the algorithm of mlcs is \$O(|\Sigma|MN)\$, where \$\Sigma\$ is the alphabet, M is the number ...