advent-of-code/2023/day07/day07.bqn
2024-11-12 21:46:18 +01:00

17 lines
611 B
BQN
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

input(56)¨•FLines"input"
hands(('0'+10)"TJQKA")¨¨input
bids•ParseFloat¨1¨input
types11111,2111,221,311,32,41,5
Ranks{(types{/𝕩}¨𝕩)𝕩}
Winnings{+´(1+𝕨)ר𝕩𝕨}
•Show bids Winnings Ranks hands
>hands2("J"('1'+9)"TQKA")¨¨input
HandType{
𝕊(00000): 5;
js0=𝕩
(+´js)+ /(¬js)/𝕩
}
Ranks2{(typesHandType¨𝕩)𝕩}
•Show bids Winnings Ranks2 hands2