#Help with coding problem

50 messages · Page 1 of 1 (latest)

teal lakeBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

wind spoke
#

Well what do you have so far?

iron sage
#

but i am sure that its not the most efficient

wind spoke
#

well for an iterative method you only need to keep track of the nth and n+1th iteration and update them in a for loop

#

subtracting them from 1000 shouldnt be the hard part in that solution

#

tbf theres other solutions as well but those are more math than coding

paper meteor
#

Wtf type of description is this

iron sage
paper meteor
iron sage
#

fib(n) = fib(n-1) + f(n-2)

#

definition of fibonacci right

#

yeah, but you are not limited to recursion for generating fibonacci numbers.

#

you can use an iterative approach which stores the previously computed value in an array

iron sage
iron sage
#

but aint do that

iron sage
#

yanderedev code is amazing

#

i have another problem

#

just wanna make sure if my thought is correct

#

okay fine :(

iron sage
#

if else...

#

switch case

#

yea

#

but yeah i actually think the iterative approach is easier

#

yea

#

this is just summation right?

#

SIR!!!!

#

😭

#

yeah

#

reading the input is probably the challenge here

#

k

#

what about this

#

looks like a graph problem

#

dfs bfs

#

okay you might be cooked for this one

#

where are ytou even getting these @iron sage

#

from sm1

#

what's sm1

#

oh

#

someone

#

yea

robust root
#

the scary bit is how superiority is represented by capital N vs lowercase j
is this from a website dedicated to macabre C++ or just your ordinary KKK university course?

iron sage
teal lakeBOT
#

This question is being automatically marked as stale.
If your question has been answered, type !solved.
If your question is not answered feel free to bump the post or re-ask.
Take a look at !howto ask for tips on improving your question.