Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

updated to [m, y, x]
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 52 bytes

Returns [max, xy, y]x].

m=>m.map((r,y)=>r.map((v,x)=>m=v<m[0]?m:[v,xy,y]x]))&&m

Try it online! Try it online!

JavaScript (ES6), 52 bytes

Returns [max, x, y].

m=>m.map((r,y)=>r.map((v,x)=>m=v<m[0]?m:[v,x,y]))&&m

Try it online!

JavaScript (ES6), 52 bytes

Returns [max, y, x].

m=>m.map((r,y)=>r.map((v,x)=>m=v<m[0]?m:[v,y,x]))&&m

Try it online!

saved 4 bytes
Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 5652 bytes

Returns [max, x, y].

m=>m.map((r,y)=>r.map((v,x)=>v<m||(c=[x=>m=v<m[0]?m:[v,y]x,m=v)y]))&&[m,c]&&m

Try it online! Try it online!

JavaScript (ES6), 56 bytes

m=>m.map((r,y)=>r.map((v,x)=>v<m||(c=[x,y],m=v)))&&[m,c]

Try it online!

JavaScript (ES6), 52 bytes

Returns [max, x, y].

m=>m.map((r,y)=>r.map((v,x)=>m=v<m[0]?m:[v,x,y]))&&m

Try it online!

Source Link
Arnauld
  • 205.5k
  • 21
  • 187
  • 670

JavaScript (ES6), 56 bytes

m=>m.map((r,y)=>r.map((v,x)=>v<m||(c=[x,y],m=v)))&&[m,c]

Try it online!

AltStyle によって変換されたページ (->オリジナル) /