Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
func dsort(m, n) {
|
||||
var h = Hash()
|
||||
n.each {|item| h{item} := 0 ++ }
|
||||
m.map {|item| h{item} := 0 -- > 0 ? n.shift : item}
|
||||
}
|
||||
|
||||
<<'EOT'.lines.each { |line|
|
||||
the cat sat on the mat | mat cat
|
||||
the cat sat on the mat | cat mat
|
||||
A B C A B C A B C | C A C A
|
||||
A B C A B D A B E | E A D A
|
||||
A B | B
|
||||
A B | B A
|
||||
A B B A | B A
|
||||
EOT
|
||||
var (a, b) = line.split('|').map{.words}...
|
||||
say "#{a.to_s} | #{b.to_s} -> #{dsort(a.clone, b.clone).to_s}"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue