Skip to main content
added 2 characters in body
Source Link

Pyth, 12 11 bytes

}Q+M^^R2hQ2

Try it online!Try it online!

Test cases

I have a feeling that pyth can do better. 11 Bytes, you know, it's in comparison to other golfing languages a lot.

The algorithm is not different from the published answers and, consequently, the performance is not sufficient to calculate the two largest test values in less than 60 sec.

Commented version:

}Q           # check whether the input value Q is within:
  +M         # the sums 
    ^      2 # of cartesian product with itself
     ^R2     # of squared
        hQ   # range of 0..Q

Pyth, 12 11 bytes

}Q+M^^R2hQ2

Try it online!

Test cases

I have a feeling that pyth can do better. 11 Bytes, you know, it's in comparison to other golfing languages a lot.

The algorithm is not different from the published answers and, consequently, the performance is not sufficient to calculate the two largest test values in less than 60 sec.

Commented version:

}Q           # check whether the input value Q is within:
  +M         # the sums 
    ^      2 # of cartesian product with itself
     ^R2     # of squared
        hQ   # range of 0..Q

Pyth, 12 11 bytes

}Q+M^^R2hQ2

Try it online!

Test cases

I have a feeling that pyth can do better. 11 Bytes, you know, it's in comparison to other golfing languages a lot.

The algorithm is not different from the published answers and, consequently, the performance is not sufficient to calculate the two largest test values in less than 60 sec.

Commented version:

}Q           # check whether the input value Q is within:
  +M         # the sums 
    ^      2 # of cartesian product with itself
     ^R2     # of squared
        hQ   # range of 0..Q
added 6 characters in body
Source Link

Pyth, 1212 11 bytes

}Q+M^^R2UhQ2Q+M^^R2hQ2

Try it online!Try it online!

Test cases

I have a feeling that pyth can do better. 1211 Bytes, you know, it's in comparison to other golfing languages a lot.

The algorithm is not different from the published answers and, consequently, the performance is not sufficient to calculate the two largest test values in less than 60 sec.

Commented version:

}Q           # check whether the input value Q is within:
  +M         # the sums 
    ^      2 # of cartesian product with itself
     ^R2     # of squared
        UhQhQ   # range of 0..Q

Pyth, 12 bytes

}Q+M^^R2UhQ2

Try it online!

Test cases

I have a feeling that pyth can do better. 12 Bytes, you know, it's in comparison to other golfing languages a lot.

The algorithm is not different from the published answers and, consequently, the performance is not sufficient to calculate the two largest test values in less than 60 sec.

Commented version:

}Q           # check whether the input value Q is within:
  +M         # the sums 
    ^      2 # of cartesian product with itself
     ^R2     # of squared
        UhQ  # range of 0..Q

Pyth, 12 11 bytes

}Q+M^^R2hQ2

Try it online!

Test cases

I have a feeling that pyth can do better. 11 Bytes, you know, it's in comparison to other golfing languages a lot.

The algorithm is not different from the published answers and, consequently, the performance is not sufficient to calculate the two largest test values in less than 60 sec.

Commented version:

}Q           # check whether the input value Q is within:
  +M         # the sums 
    ^      2 # of cartesian product with itself
     ^R2     # of squared
        hQ   # range of 0..Q
Source Link

Pyth, 12 bytes

}Q+M^^R2UhQ2

Try it online!

Test cases

I have a feeling that pyth can do better. 12 Bytes, you know, it's in comparison to other golfing languages a lot.

The algorithm is not different from the published answers and, consequently, the performance is not sufficient to calculate the two largest test values in less than 60 sec.

Commented version:

}Q           # check whether the input value Q is within:
  +M         # the sums 
    ^      2 # of cartesian product with itself
     ^R2     # of squared
        UhQ  # range of 0..Q