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

added 44 characters in body
Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

R, 55(削除) 55 (削除ここまで) 54 bytes

Edit: -1 byte thanks to pajonk

function(x)max(lengths(apply(expand.grid(x),1,uniquetable)))

Try it online! Try it online!

Test setup stolen from pajonk's R answer.
48 bytes using R ≥ 4.1 by exchanging function for \.

R, 55 bytes

function(x)max(lengths(apply(expand.grid(x),1,unique)))

Try it online!

Test setup stolen from pajonk's R answer.
48 bytes using R ≥ 4.1 by exchanging function for \.

R, (削除) 55 (削除ここまで) 54 bytes

Edit: -1 byte thanks to pajonk

function(x)max(lengths(apply(expand.grid(x),1,table)))

Try it online!

Test setup stolen from pajonk's R answer.
48 bytes using R ≥ 4.1 by exchanging function for \.

Source Link
Dominic van Essen
  • 37.2k
  • 2
  • 24
  • 61

R, 55 bytes

function(x)max(lengths(apply(expand.grid(x),1,unique)))

Try it online!

Test setup stolen from pajonk's R answer.
48 bytes using R ≥ 4.1 by exchanging function for \.

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