according to mathworld.wolfram.com/MatrixNorm.html, the common meaning of "the" matrix norm (even though there isn't just one definition, but spectral norm is most common) is sqrt of the max eigenvalue of $A^HA$ where $A^H$ is the conjugate transpose
The problem is, JS's default number type is a float, so I have to use BigInts to mantain the use of large integers. Fortunately, it's only adding BigInts to Numbers (floats) that errors.
I also had several obvious bugs - for example, implicit input when readying a stack for a function call was failing because it was trying to tak input from the stack it was building for the function.
(Oh wait, I don’t know how to upload on mobile. It’s just a screenshot of a dialog box about “the new mobile chat.” By now I’ve way over-hyped it and you’ll be disappointed, but if you don’t know about it, I do recommend trying it.)
Given N items (0 < N <= 50) with prices (which are always integers) P0 ... PN-1 and given amounts of each item A0 ... AN-1, determine how much the total cost will be.
Examples
N: 2
P0: 2
P1: 3
A0: 1
A1: 4
Result: 14
N: 5
P0: 2
P1: 7
P2: 5
P3: 1
P4: 9
A0: 1
A1: 2
A2: 3
A3: 2
A4: 3
Result: 60
R...
When doing I/O as a function taking input and returning something, does the function declaration count towards the byte count? Or is it just the function body?
NP-complete reduction: grid-Hamiltonian circuit code-golf open-ended-function graph-theory restricted-complexity
Background
Hamiltonian circuit problem is a decision problem which asks whether a given graph has a Hamiltonian circuit, i.e. a cycle that visits every vertex exactly once. This proble...
For instance, if you had to return [1..10], and couldn't use a list comprehension, for i in range(10): yield i is one byte shorter than for i in range(10): print(i)
This is neat! I golfed 6 bytes off this already great and very clever answer. First time golfing Python. Thanks for all your help, guys: codegolf.stackexchange.com/a/229898/87594
Drop some boxes
Say I have a pile of boxes:
AAA
BBB
I can create it in two steps:
BBB
↓
AAA
↓
BBB
But with this:
AB
BA
I need three steps:
A
↓
BB
↓
A
A
↓
B
BA
Your challenge
Given a pile of boxes, output the minimum number of steps needed to create that pile.
A step consists o...
Jump trajectory
code-golf ascii-art string
This is an ascii-art challenge where you will draw ascii-art showing a person "jumping" off the top of a building.
The building
Input given will be a group of rectangular buildings. You may assume buildings are not "stacked on top of each other", hence...
A large number of stamps code-golf integer-partitionsarithmetic
I have a large number of stamps of several different values. It's really annoying when I can't make a total exactly, so please write me some code to help me with this.
Your challenge
Your challenge is to make a function or program th...