New answers tagged programming-challenge
3
votes
The smallest positive number that is evenly divisible by all of the numbers from 1 to 20
Straight.
If you
- defined "the range-LCM" in a function with a docsting
- presented imports
and test cases or usage examples,
- added boundary checks (try ...
0
votes
The largest palindrome made from the product of two 3-digit numbers
Your upper_limit and lower_limit variable definition is a little bit complicated because it involves integer division.
_
...
1
vote
The largest palindrome made from the product of two 3-digit numbers
Style Guide for Python Code
A few PEP 8 items:
parenthesis are unnecessary in (10**(n))-1; write 10 ** n - 1
use a space around ...
3
votes
The largest palindrome made from the product of two 3-digit numbers
Outsource secondary calculations to helper functions. Your current
code is reasonable. Its primary drawback is that the Euler-solving
code is cluttered up with the details of checking for palindrome ...
3
votes
Calculate the first largest factor of 600851475143
There is a style guide for Python you can consult.
There is no use in trying to be creative when formatting the code, so you should write
_
...
4
votes
Calculate the first largest factor of 600851475143
Couple of points:
Use integer division, the double slash //. This has an update partner //= too so ...
2
votes
Deepest pit of an array
function deepest_pit(B) {
The JavaScript style guide here indicates that camelCase is recommended for functions. JavaScript is ...
6
votes
Deepest pit of an array
Overall, reading this code, my reaction is "huh?". It looks like a bunch of gibberish at first (and second) glance. There are no english words. I would not want to maintain this code after ...
-1
votes
1
vote
-1
votes
New Year Chaos JavaScript, needs to be sped up
The input array is: [1 2 5 3 7 8 6 4], which means that:
5 jumps 2 positions, so increment counter by 2 (c = 2)
7 jumps 2 positions, so increment counter by 2 (c = 4)
8 jumps 2 positions, so ...
-1
votes
1
vote
Accepted
JavaScript function that generates Fibonacci like sequences of given order
Your algorithm for an n element Fibbonacci series order k is O(N*K) Your JavaScript implementation may be inefficient. I revised your algorithm to become O(N). I revised your JavaScript implementation ...
Top 50 recent answers are included
Related Tags
programming-challenge × 3277python × 969
algorithm × 658
java × 635
performance × 630
time-limit-exceeded × 493
c++ × 479
python-3.x × 425
beginner × 423
c# × 306
javascript × 285
strings × 212
primes × 178
c × 147
functional-programming × 114
array × 104
haskell × 97
python-2.x × 93
interview-questions × 92
dynamic-programming × 84
ruby × 76
recursion × 76
object-oriented × 75
palindrome × 71
combinatorics × 68