Jump to content

Alternade words: Difference between revisions

→‎{{header|Ruby}}: bsearch block
(→‎{{header|Ruby}}: Added Ruby)
(→‎{{header|Ruby}}: bsearch block)
Line 2,545:
next if word.size < 6
splitted = word.each_char.partition.with_index{|_,i| i.even? }.map(&:join)
next unless splitted.all?{|split| words.bsearch{|w| wsplit <=>= split w} == split}
"#{word}: #{splitted.join(", ")}"
end
Line 2,611:
twirly: til, wry
</pre>
 
=={{header|Rust}}==
<lang rust>use std::collections::BTreeSet;
1,149

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.