Cheryl's birthday: Difference between revisions
m
→{{header|Sidef}}: updated code to use the built-in Date class
Thundergnat (talk | contribs) m (Thundergnat moved page Cheryl's Birthday to Cheryl's birthday: Follow normal task title capitalization policy) |
m (→{{header|Sidef}}: updated code to use the built-in Date class) |
||
Line 2,425:
=={{header|Sidef}}==
{{trans|Raku}}
<lang ruby>
Date.parse("#{day} #{month}", "%d %B")
}
var dates = [
]
var filtered = dates.grep {
dates.grep {
dates.map{ .day }.count(.day) == 1
}.map{ .month }.count(.month)
}
var birthday = filtered.grep {
filtered.map{ .day }.count(.day) == 1
}.group_by{ .month }.values.first_by { .len == 1 }[0]
say "Cheryl's birthday is #{birthday.
{{out}}
<pre>
|