Skip to main content
More words
Source Link
Veskah
  • 4.1k
  • 13
  • 29

PowerShell, 66 37 26 bytes

-11 bytes thanks to mazzy

!(($args|group|% c*t)-ne2)

Try it online!

Groups up $l and iterates through itgrabs all the counts of matching values. It then filters out all counts of 2 from this list. If the list is empty, checking each group'sit's a Noah number; otherwise, it'll be populated still with non-2 counts. Not-ing the list will yield countTrue to see if they're size 2.it's empty and False if it's populated

PowerShell, 66 37 26 bytes

-11 bytes thanks to mazzy

!(($args|group|% c*t)-ne2)

Try it online!

Groups up $l and iterates through it, checking each group's count to see if they're size 2.

PowerShell, 66 37 26 bytes

-11 bytes thanks to mazzy

!(($args|group|% c*t)-ne2)

Try it online!

Groups up $l and grabs all the counts of matching values. It then filters out all counts of 2 from this list. If the list is empty, it's a Noah number; otherwise, it'll be populated still with non-2 counts. Not-ing the list will yield True if it's empty and False if it's populated

AAAAAAAAAAAAAA
Source Link
Veskah
  • 4.1k
  • 13
  • 29

PowerShell, 66 3737 26 bytes

-11 bytes thanks to mazzy

!(($args|group|% c*t|%{$_c*t)-eq2}|sortne2)[0]

Try it online!Try it online!

Groups up $l and iterates through it, checking each group's countcount to see if they're size 2. It pushes all the check's output (True or False) to the pipeline, sorts them all, and pushes the first index to STDOUT. If any check failed, it will be False due to the sort.

PowerShell, 66 37 bytes

($args|group|% c*t|%{$_-eq2}|sort)[0]

Try it online!

Groups $l and iterates through it, checking each group's count to see if they're size 2. It pushes all the check's output (True or False) to the pipeline, sorts them all, and pushes the first index to STDOUT. If any check failed, it will be False due to the sort.

PowerShell, 66 37 26 bytes

-11 bytes thanks to mazzy

!(($args|group|% c*t)-ne2)

Try it online!

Groups up $l and iterates through it, checking each group's count to see if they're size 2.

Less idiotic route
Source Link
Veskah
  • 4.1k
  • 13
  • 29

PowerShell, 6666 37 bytes

param($l)(($l|sort$args|group|% -u)|%{$z=$_;($l|?c*t|%{$_-eq$z}).count-eq2}|sort)[0]

Try it online!Try it online!

SortsGroups $l into a unique list. It thenand iterates through it, checking each sub-list of matching values from the full listgroup's count to see if they're size 2. It pushes all the check's output (True or False) to the pipeline, sorts them all, and pushes the first index to STDOUT. If any check failed, it will be False due to the sort.

A 30 byte bug fix :'D

PowerShell, 66 bytes

param($l)(($l|sort -u)|%{$z=$_;($l|?{$_-eq$z}).count-eq2}|sort)[0]

Try it online!

Sorts $l into a unique list. It then iterates through it, checking each sub-list of matching values from the full list to see if they're size 2. It pushes all the check's output (True or False) to the pipeline, sorts them all, and pushes the first index to STDOUT. If any check failed, it will be False due to the sort.

A 30 byte bug fix :'D

PowerShell, 66 37 bytes

($args|group|% c*t|%{$_-eq2}|sort)[0]

Try it online!

Groups $l and iterates through it, checking each group's count to see if they're size 2. It pushes all the check's output (True or False) to the pipeline, sorts them all, and pushes the first index to STDOUT. If any check failed, it will be False due to the sort.

Post Undeleted by Veskah
I fixed it
Source Link
Veskah
  • 4.1k
  • 13
  • 29
Loading
Post Deleted by Veskah
Source Link
Veskah
  • 4.1k
  • 13
  • 29
Loading