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

Commonmark migration
Source Link

#Mathematica, (削除) 135 (削除ここまで) 123 bytes

Mathematica, (削除) 135 (削除ここまで) 123 bytes

Max[(s=#;r=#2;Max[Tr/@Partition[#,r,1]&/@Join[s,s~Diagonal~#&/@Range[-(t=Tr[1^#&@@s])+2,t-1]]])&@@@{#|#2,Reverse@#|#2}]&

Try it online!

#Mathematica, (削除) 135 (削除ここまで) 123 bytes

Max[(s=#;r=#2;Max[Tr/@Partition[#,r,1]&/@Join[s,s~Diagonal~#&/@Range[-(t=Tr[1^#&@@s])+2,t-1]]])&@@@{#|#2,Reverse@#|#2}]&

Try it online!

Mathematica, (削除) 135 (削除ここまで) 123 bytes

Max[(s=#;r=#2;Max[Tr/@Partition[#,r,1]&/@Join[s,s~Diagonal~#&/@Range[-(t=Tr[1^#&@@s])+2,t-1]]])&@@@{#|#2,Reverse@#|#2}]&

Try it online!

added 23 characters in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87

#Mathematica, (削除) 135 (削除ここまで) 123 bytes

Max[(s=#;r=#2;Max[Tr/@Partition[#,r,1]&/@Join[s,s~Diagonal~#&/@Range[-(t=Tr[1^#&@@s])+2,t-1]]])&@@@{#|#2,Reverse@#|#2}]&

Try it online! Try it online!

#Mathematica, (削除) 135 (削除ここまで) 123 bytes

Max[(s=#;r=#2;Max[Tr/@Partition[#,r,1]&/@Join[s,s~Diagonal~#&/@Range[-(t=Tr[1^#&@@s])+2,t-1]]])&@@@{#|#2,Reverse@#|#2}]&

Try it online!

#Mathematica, (削除) 135 (削除ここまで) 123 bytes

Max[(s=#;r=#2;Max[Tr/@Partition[#,r,1]&/@Join[s,s~Diagonal~#&/@Range[-(t=Tr[1^#&@@s])+2,t-1]]])&@@@{#|#2,Reverse@#|#2}]&

Try it online!

deleted 8 characters in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87

#Mathematica, (削除) 135 (削除ここまで) 130123 bytes

Max[(s=#;r=#2;Max[Tr/@Partition[#,r,1]&/@Join[s,s~Diagonal~#&/@Range[-(t=Tr[1^#&@@s])+2,t-1]]])&@@@{Transpose@#|#2#|#2,Reverse@#|#2}]&

Try it online! Try it online!

#Mathematica, (削除) 135 (削除ここまで) 130 bytes

Max[(s=#;r=#2;Max[Tr/@Partition[#,r,1]&/@Join[s,s~Diagonal~#&/@Range[-(t=Tr[1^#&@@s])+2,t-1]]])&@@@{Transpose@#|#2,Reverse@#|#2}]&

Try it online!

#Mathematica, (削除) 135 (削除ここまで) 123 bytes

Max[(s=#;r=#2;Max[Tr/@Partition[#,r,1]&/@Join[s,s~Diagonal~#&/@Range[-(t=Tr[1^#&@@s])+2,t-1]]])&@@@{#|#2,Reverse@#|#2}]&

Try it online!

added 9 characters in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87
Loading
added 48 characters in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87
Loading
deleted 6 characters in body
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87
Loading
Source Link
ZaMoC
  • 25.5k
  • 2
  • 32
  • 87
Loading

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