Timeline for Find the number of integers in the range from 1 to N that ends with 2
Current License: CC BY-SA 4.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 6, 2021 at 16:02 | history | edited | 4R1u | CC BY-SA 4.0 |
added 4 characters in body; added 1 character in body
|
Jan 5, 2021 at 13:48 | comment | added | Danis | lambda N:sum(x%10==2for x in range(N+1)) | |
Mar 13, 2020 at 14:55 | history | edited | 4R1u | CC BY-SA 4.0 |
deleted 14 characters in body
|
Mar 13, 2020 at 14:50 | comment | added | 4R1u | It doesn't work | |
Mar 13, 2020 at 14:50 | review | First posts | |||
Mar 13, 2020 at 15:18 | |||||
Mar 11, 2020 at 21:48 | comment | added | Jo King♦ | Can you please format your answer correctly? There appears to be an extra four spaces of indentation as well as a newline | |
Mar 11, 2020 at 15:10 | history | edited | 4R1u | CC BY-SA 4.0 |
added 42 characters in body
|
Mar 11, 2020 at 14:07 | history | edited | 4R1u | CC BY-SA 4.0 |
added 38 characters in body
|
Mar 6, 2020 at 10:48 | comment | added | DeathIncarnate | If you wish to solve it this way, with iteration, you may be best off using list-comprehension and check the len, it's definitely not the best way to approach it. Also, it's often best to express it as a lambda function to save chars. Try it online! | |
Mar 2, 2020 at 19:29 | comment | added | John | Welcome! Please see codegolf.stackexchange.com/questions/54/… for golfing in Python, and observe patterns in other questions that might help you get an idea on the practices in code golfing. Note the objective is not just to solve the problem at hand (in fact, generally we borrow solutions already posted and port into other languages) but also to implement the solution as efficiently as possible. | |
Mar 2, 2020 at 17:22 | comment | added | Bob Jarvis - Слава Україні | My best advice, for this challenge and in general, is to think about the problem and try to figure out a way to compute the result directly instead of iterating through all the numbers, etc. Iteration is slow, and sometimes it's the only solution - but very often there's A Better Way that you can find if you put some thought into it. | |
Mar 2, 2020 at 13:37 | comment | added | USERNAME GOES HERE | See the upper answer. | |
Mar 2, 2020 at 13:32 | history | edited | 4R1u | CC BY-SA 4.0 |
added 1 character in body
|
Mar 2, 2020 at 13:30 | comment | added | 4R1u | can you help me then? | |
Mar 2, 2020 at 13:12 | history | answered | 4R1u | CC BY-SA 4.0 |