<gorom>
nvm these guys are dic*heads, some stupid LLM answer my question but programmers with 15 years of expertise doesn't even understand why I'm asking
<gorom>
what*
<weaksauce>
just says page not found for me
<gorom>
I deleted the post It doesnt get approveed
<gorom>
I made it visible if you like to take a look
<weaksauce>
still says page not found
<gorom>
oh okay, my bad, they don't want to make it visible, I'll copy it somewhere
<gorom>
it is what I posted there, however they stated that question is unclear, chatbot proved my point, but I'll be really glad if somebody alive could prove it as well
<kjetilho>
"the number that is formed by selecting the last digit" is not clear
<weaksauce>
the leetcode solution is correct if the question is worded that way
<weaksauce>
the only digit divisible by 10 is 0
<kjetilho>
yes, I agree. I just thought it was a silly question
<weaksauce>
it's a dumb question yeah
<kjetilho>
but I see now it is intended to check if the examinand can spot the simple optimisation
<weaksauce>
i guess
<weaksauce>
if i got that in an interview i'd be annoyed
<kjetilho>
gorom: the "leetcode" is better since it only looks at a single element of the array
<kjetilho>
I agree with the moderators, though - too much of a homework question, does not have a lasting value for the site
<gorom>
it seems to take a last digit from all elements, is it okay if I just pick last digit of an array ?
<kjetilho>
gorom: right, exactly. so the last digits should be concatenated like the leetcode solution does
<kjetilho>
gorom: all the preceding digits to not matter
<gorom>
thanks, I owe you
<kjetilho>
gorom: the key here: this optimisation ONLY works when checking for divisibility with 10
<gorom>
I see
<kjetilho>
gorom: if it was 3, you would have to do it your way
<kjetilho>
can you solve it efficiently for 5?
<gorom>
well, I have to try harder then
<gorom>
hmm, I guess
<gorom>
lets check
<kjetilho>
(for 3 (or 7, or 9), you could take a shortcut and answer NO if the last digit has a special property (which?), and if not, do the full sum.)
<kjetilho>
now you have two bonus questions :)
<weaksauce>
well 5 is easy enough too... 5 or 0
<kjetilho>
weaksauce: shhh!
<weaksauce>
hah soory
<gorom>
shh Im coding :DD
<gorom>
but I know the answer already, lets check for the rest
<gorom>
I need to finish sandwich first tho :-)
user71 has quit [Quit: Leaving]
balo has quit [Remote host closed the connection]
olspookishmagus has joined #ruby
<gorom>
kjetilho: so for 7 and 9 the last digit method works, but I cannot figure out how to check for 3 only with the last digit
<gorom>
I have to check all elements, right?
<gorom>
ah, okay I've got your point if the last digit is not 3 6 9 or I guess 0 I can answer No, then check
<weaksauce>
what's 3x4
<kjetilho>
hrm, I haven't thought it completely through, but if the last digit is even, it can't be divisble by 3, 7 or 9.
balo has joined #ruby
<weaksauce>
nevermind
<kjetilho>
that was the test I had in mind
<kjetilho>
but I might be wrong.
<kjetilho>
don't have the energy to think now :)
<weaksauce>
anyway 3xn will eventually have every last digit so that's not a reliable test
<kjetilho>
yes, I think I messed up
mjanssen has joined #ruby
Vonter has quit [Ping timeout: 244 seconds]
Linux_Kerio has quit [Ping timeout: 252 seconds]
Vonter has joined #ruby
<gorom>
I'm coding in vim and I missed end somewhere, can I tell by the error which line?
<gorom>
oh okay I can
<gorom>
so as I mentioned I'm very low in programming and it seems I didn't understand question, but optimalization come later, just coding. Here is my very low code, took me way too long haha. by7 is wild. I have to learn Rspec to debug this beast I guess. Can somebody point me the worst practices I used here? The code is very bad, no code and even I forget what the question was