Skip to main content
5 of 6
Reduced the code by 11 bytes
Endenite
  • 4.1k
  • 12
  • 28

Javascript (ES6), 121 110 bytes

-11 Bytes thanks to @Shaggy

m=>`[[${(a=m.split`
`.map(x=>x.trim().replace(/ +/g,", "))).join`], [`}]]
{{${a.join`}, {`}}}
[${a.join`; `}]`"

Example code snippet:

f=

m=>`[[${(a=m.split`
`.map(x=>x.trim().replace(/ +/g,", "))).join`], [`}]]
{{${a.join`}, {`}}}
[${a.join`; `}]`

console.log(f(
`1 -2
 3  5
 6  7`
))

Endenite
  • 4.1k
  • 12
  • 28