Skip to main content
added 84 characters in body
Source Link
dana
  • 2.7k
  • 1
  • 15
  • 11

JavaScript (Node.js), 64 bytes

c=>a=>[,7.77,a.sort()[1]-a[2]?2:3,1,.1][new Set(a).size]+c/100|0size]+c*.01|0

Try it online!Try it online!

I figurefigured there hashad to be at least one JSJavaScript answer to an Arnauld challenge.!

The concept here is mainly to use the number of distinct elements as a lookup key:.

  • 1 unique => 4 of a kind
  • 2 unique => 2 pair or 3 of a kind
  • 3 unique => 1 pair
  • 4 unique => nothingno matches

In order to distinguish between 2 pair and 3 of a kind, the input array is sorted and the middle 2 elements are compared.

JavaScript (Node.js), 64 bytes

c=>a=>[,7.77,a.sort()[1]-a[2]?2:3,1,.1][new Set(a).size]+c/100|0

Try it online!

I figure there has to be at least one JS answer to an Arnauld challenge.

The concept here is mainly to use the number of distinct elements as a lookup key:

  • 1 unique => 4 of a kind
  • 2 unique => 2 pair or 3 of a kind
  • 3 unique => 1 pair
  • 4 unique => nothing

In order to distinguish between 2 pair and 3 of a kind, the input array is sorted and the middle 2 elements are compared.

JavaScript (Node.js), 64 bytes

c=>a=>[,7.77,a.sort()[1]-a[2]?2:3,1,.1][new Set(a).size]+c*.01|0

Try it online!

I figured there had to be at least one JavaScript answer to an Arnauld challenge!

The concept here is mainly to use the number of distinct elements as a lookup key.

  • 1 unique => 4 of a kind
  • 2 unique => 2 pair or 3 of a kind
  • 3 unique => 1 pair
  • 4 unique => no matches

In order to distinguish between 2 pair and 3 of a kind, the input array is sorted and the middle 2 elements are compared.

added 317 characters in body
Source Link
dana
  • 2.7k
  • 1
  • 15
  • 11

JavaScript (Node.js), 64 bytes

c=>a=>[,7.77,a.sort()[1]-a[2]?2:3,1,.1][new Set(a).size]+c/100|0

Try it online!

I figure there has to be at least one JS answer to an Arnauld challenge.

The concept here is mainly to use the number of distinct elements as a lookup key:

  • 1 unique => 4 of a kind
  • 2 unique => 2 pair or 3 of a kind
  • 3 unique => 1 pair
  • 4 unique => nothing

In order to distinguish between 2 pair and 3 of a kind, the input array is sorted and the middle 2 elements are compared.

JavaScript (Node.js), 64 bytes

c=>a=>[,7.77,a.sort()[1]-a[2]?2:3,1,.1][new Set(a).size]+c/100|0

Try it online!

I figure there has to be at least one JS answer to an Arnauld challenge.

JavaScript (Node.js), 64 bytes

c=>a=>[,7.77,a.sort()[1]-a[2]?2:3,1,.1][new Set(a).size]+c/100|0

Try it online!

I figure there has to be at least one JS answer to an Arnauld challenge.

The concept here is mainly to use the number of distinct elements as a lookup key:

  • 1 unique => 4 of a kind
  • 2 unique => 2 pair or 3 of a kind
  • 3 unique => 1 pair
  • 4 unique => nothing

In order to distinguish between 2 pair and 3 of a kind, the input array is sorted and the middle 2 elements are compared.

deleted 31 characters in body
Source Link
dana
  • 2.7k
  • 1
  • 15
  • 11

JavaScript (Node.js), 64 bytes

c=>a=>[,7.77,a.sort()[1]-a[2]?2:3,1,.1][new Set(a).size]+c/100|0

Try it online!

I am certain that this is golfable, butfigure there has to be at least one JS answer to an Arnauld challenge.

JavaScript (Node.js), 64 bytes

c=>a=>[,7.77,a.sort()[1]-a[2]?2:3,1,.1][new Set(a).size]+c/100|0

Try it online!

I am certain that this is golfable, but there has to be at least one JS answer to an Arnauld challenge.

JavaScript (Node.js), 64 bytes

c=>a=>[,7.77,a.sort()[1]-a[2]?2:3,1,.1][new Set(a).size]+c/100|0

Try it online!

I figure there has to be at least one JS answer to an Arnauld challenge.

deleted 3 characters in body; deleted 2 characters in body
Source Link
dana
  • 2.7k
  • 1
  • 15
  • 11
Loading
deleted 33 characters in body; edited body
Source Link
dana
  • 2.7k
  • 1
  • 15
  • 11
Loading
deleted 4 characters in body
Source Link
dana
  • 2.7k
  • 1
  • 15
  • 11
Loading
deleted 3 characters in body
Source Link
dana
  • 2.7k
  • 1
  • 15
  • 11
Loading
Source Link
dana
  • 2.7k
  • 1
  • 15
  • 11
Loading