Questions tagged [substrings]
The substrings tag has no usage guidance.
14 questions
0
votes
0
answers
123
views
DNA is good for the small database but not for the large database - CS50 Pset6
I'm currently developing the small and the large database functions separately and I wonder why in the large one it does not keep track of the STR repetitions. Here is my code from both functions:
...
0
votes
1
answer
27
views
I am not sure what is wrong with my substrings code
def substrings(a, b, n):
"""Return substrings of length n in both a and b"""
# takes in strings input a and b
# splits each string into substrings
lista = [a[i:j] for i in range(0, (...
0
votes
1
answer
109
views
PSET 7 similarities substrings function seems ok but dont pass test
I make a substrings function, it seems to work for me, but i cant pass check.
:( handles one substring in common
Expected 1 matches, not 0
:( handles multiple substrings in common
Expected 4 ...
0
votes
1
answer
134
views
I'm stuck on cs50 pset2 - crack
I am new to coding. I am trying to solve crack problem of cs50. The problem works hashing 1 character, but when i try to hash 2 characters i can't pass arguments from the string to the crypt function. ...
0
votes
1
answer
145
views
Where am I going wrong in Similarities: Substrings?
I am currently working on PSet7: Similarities. I have completed all the tests so far except substrings and I was wondering if any of you could tell me where I am going wrong. I am currently failing ...
1
vote
2
answers
292
views
Pset6 similarities less substrings I get wrong output
I’m super close. But I cannot figure out right formula. It doesn’t count amount of the similar substrings correctly. I mean the output is wrong.
https://pastebin.com/gEvxAS1X
1
vote
1
answer
380
views
PSET6 Similarities substrings almost done
def substrings(a, b, n):
"""Return substrings of length n in both a and b"""
global seta
global setb
x = []
y = []
for i in range(len(a) - n + 1):
x.append(a[i:i+n])
...
1
vote
1
answer
236
views
PSET6 Similarities HELP!
I am almost done with similarities I think. Can't really figure out what is wrong with my substrings
def substrings(a, b, n):
"""Return substrings of length n in both a and b"""
x = []
y =...
0
votes
1
answer
551
views
pset6 similarities substrings fails check50 in 3 cases, but not sure what's wrong with logic
My code isn't efficient, but it's not convoluted which is rare for me. I wrote a helper function, 'slicer', which iterates over the length of a and slices a into length n substrings. 'Substrings' ...
0
votes
1
answer
48
views
PSET5 speller: all words listed as mispelled and check50 gives substrings a sad face
I made my dictionary.c for my speller program, however...
it lists the whole text as mispelled
check50 gives a sad face for substrings, showing that in its testing, "cat" is listed as mispelled, ...
0
votes
1
answer
107
views
Trouble with Substrings in Check in Pset5
I have used a trie structure to implement my dictionary in pset5 and I believe my load() function is operating correctly, however I seem to be having trouble with checking substrings in the check() ...
0
votes
2
answers
2k
views
strstr function not working
#include <stdio.h>
#include<cs50.h>
#include <string.h>
char array[][80] = {"CS50", "C Programming", "Java", "Python", "PHP",};
void find(char search[])
{
for (int i = 0; i ...
0
votes
1
answer
328
views
Check50. I need help with server.c, specifically with the parse function I guess. Thanks
I have just finished the 4 functions from Pset 6 (server.c). Well, everything works "fine". If I request /cat.html it returns HTTP/1.1 200 OK and if request cat.exe it returns the most famous server ...
0
votes
1
answer
337
views
pset5 speller doesn't handle possesive and substrings properly
I got the following error while checking my pset5.
:( handles possessives properly
\ expected output, but not "\nMISSPELLED WORDS\n\n\nWORDS MISSPELLE..."
:( handles substrings properly
\ ...