My coding education journey has been a bit, disjointed to say the least. I've stop started on freeCodeCamp, CS50, other tutorials, books, and just ...
For further actions, you may consider blocking this person and/or reporting abuse
The last code test I took for an interview involved writing a calculator in Java:
pro:
con:
Whew man, I don’t know Java at all, so this looks really complicated to me.
The way it works is by subtracting until you can add based only on the one-to-one mapping in descending order. So if you're trying to convert 1990, it goes like this:
1000 - (1000 / 10)
), so we set thelastEntry
pointer to M and proceedlastEntry
is set. 990 > 900 which is CM, giving us MCM so far and leaving 90. I think this is where the bug is but it works in this case :)100 - (100 / 10)
) solastEntry
is now ClastEntry
is set, but the calculation to test whether L can be subtracted fails, so we proceedNice that’s such a cool way of thinking about it!
Mine works... but I every time I tried doing something clever to not have to define 900, 400, 90, 40, and 9, it wouldn't work on 4, so I gave up on that. I really liked the .repeat so I didn't have to define multiples, though.