Q-Sequence Code Coach | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Q-Sequence Code Coach

Hey, so I'm doing the Q-Sequence code coach and, just like I expected, this code doesn't work(That'd be too easy). Can anybody help me? I'm not sure where to start with this one. https://code.sololearn.com/cx5H8GAcr2Do/?ref=app

24th Jul 2020, 8:20 PM
Daniel Cooper
Daniel Cooper - avatar
5 Respostas
+ 2
I took a crack at it and it seems your method is too slow. There are certain techniques ( whose name I'm omitting because of the challenge ) that you can use to greatly reduce the number of recursion calls. More specifically you're wasting alot of time by recalculating the same result in several recursive calls which you could optimize for.
24th Jul 2020, 9:07 PM
Dennis
Dennis - avatar
29th Jul 2020, 6:13 PM
Dennis
Dennis - avatar
0
Daniel Cooper how does the question look like?
25th Jul 2020, 1:02 AM
CalviÕ²
CalviÕ² - avatar
0
Dennis Any chance you can point me in the direction of that technique? I can't find anything about any techniques.
29th Jul 2020, 6:11 PM
Daniel Cooper
Daniel Cooper - avatar
0
Daniel Cooper Use Hashtable to make memorization code, avoid recalculation. https://code.sololearn.com/c3yjb8X1S19m/?ref=app
30th Jul 2020, 2:14 AM
CalviÕ²
CalviÕ² - avatar