Timeline for Hacker Rank: Extracting digits from a given number and check for divisibility
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 26, 2019 at 6:38 | history | edited | Kanahaiya | CC BY-SA 4.0 |
added 235 characters in body
|
Mar 25, 2019 at 14:54 | comment | added | Toby Speight | Sorry, I meant that you might want to edit the answer with that information, rather than comment. It's a good idea to present the alternatives and justify your preference if you can. | |
Mar 25, 2019 at 13:45 | comment | added | Kanahaiya | I just google and find this article -embeddedgurus.com/stack-overflow/2011/02/… which mentioned that modulo is slower than subtraction because it performs division + subtraction in between to calculate the same. that C = A % B is equivalent to C = A – B * (A / B) In that case i feel simpler abstraction is having good performance over modulo. | |
Mar 25, 2019 at 9:12 | comment | added | Toby Speight |
Any comments on the performance of % compared to the simpler subtraction?
|
|
Mar 23, 2019 at 17:26 | history | edited | Stephen Rauch | CC BY-SA 4.0 |
Minor formatting
|
Mar 23, 2019 at 17:20 | review | Late answers | |||
Mar 23, 2019 at 17:26 | |||||
Mar 23, 2019 at 17:00 | history | answered | Kanahaiya | CC BY-SA 4.0 |