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,14 @@
|
|||
func pancake(a) {
|
||||
for idx in ^(a.end) {
|
||||
var min = idx
|
||||
for i in (idx+1 .. a.end) { min = i if (a[min] > a[i]) }
|
||||
next if (a[min] == a[idx])
|
||||
a[min..a.end] = [a[min..a.end]].reverse...
|
||||
a[idx..a.end] = [a[idx..a.end]].reverse...
|
||||
}
|
||||
return a
|
||||
}
|
||||
|
||||
var arr = 10.of{ 100.irand }
|
||||
say "Before: #{arr}"
|
||||
say "After: #{pancake(arr)}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue