Hi folks! Much thanks for last weeks submissions!
Here is a (very) interesting blogpost about how FOSDEM 2021 was setup: https://www.matrix.org/blog/posts. Perhaps something we should try out as a community as time goes by?
That withstanding, this week I've been thinking about backups. How do you back up your systems? At work, if you can talk about it, what's your backup strategy?
Issue 0: https://is.gd/b99nd2
Mailing List discussion: https://groups.google.com/g/nairobi-gnu/c/H6qSbSQ7rTk
If you get the bandwidth, hack at the problems at the submission links above-- It's a nice way to get comments on your code \m/\m/.
Write a procedure that partions a list into even and odd numbers. Order doesn't really matter.
Constraint: Try doing this without creating a new array.
Examples:
Input: n = [1, 2, 3, 4, 5, 6, 7]
Output: [2, 4, 6, 1, 3, 5, 7]
Input: n = []
Output: []
Input: n = [1, 2]
Output: [2, 1]
Post your solutions as comments to this gist
@BonfaceKilz There's a method called
partition_in_place
in rust nighly.The problem is that it isn't stable.
I could reduce one heap allocation by taking ownership of the even and odd vectors.
I could create a functional approach that doesn't make a heap allocation but it would require
more lines of code. I'll post the solution today.