Haha nice. Honestly, I'm just so used to copy/pasting emojis from slack and discord. Fun fact, when you do that, it copies the colon emoji syntax, not the unicode glyph 😅🙃
Oh, I know almost nothing about Go. I'm specifically using these exercises to learn the syntax. No clue if and how what I'm doing can be optimized. Go is famously, weirdly restrictive and intentionally verbose.
Hi! My name is Paulo. I'm a full stack dev, i like many things, but the top five is: Tecnology, Great ideas for projects, Awesome People, Work for a nice ideia, Play Games (League of Legends).
Without lifetime
We return a new Vec free from any list provided, by cloning the data. The generic data type only allows the data type that implements Clone trait to be passed.
Wednesday
Array.diff (6 KYU):
Your goal in this kata is to implement a difference function, which subtracts one list from another and returns the result.
CodeWars
Python!
List comprehensions are truly a gift.
YES -- they are so elegant.
Or with sets!
F#
also sequence expression syntax
Or (although it will also remove duplicates from a):
Yes, this was my first thought, but I was trying to retain dupes.
Just define the subtraction operator and done.
Go
Common Lisp
I'll use lists because... well, it's Lisp, right?
Can't beat a good standard library ;)
Tried in Javascript
Nice!!
Wow, great! So clean!
this is beautiful. thanks
Ruby
That's amazing!
On the other hand, Ruby probably allocated about 10,000 object references under the hood and used 1gb of memory to make that happen. 😄
Honestly, I just came out here to have a good time and I'm feeling so attacked right now 😅😅😅
github.com/thepracticaldev/dev.to/... 🙃
Haha nice. Honestly, I'm just so used to copy/pasting emojis from slack and discord. Fun fact, when you do that, it copies the colon emoji syntax, not the unicode glyph 😅🙃
@bendhalpern some numbers (using /usr/bin/time -l on OSX):
Disclaimer: I'm inexperienced with Go; using the example from below 😅
Oh, I know almost nothing about Go. I'm specifically using these exercises to learn the syntax. No clue if and how what I'm doing can be optimized. Go is famously, weirdly restrictive and intentionally verbose.
kkkkk it's very simple dude :D
Similar effort when done in APL! :)
Ah, cannot
unseethis answer... 😆Same in Kotlin :)
Rust
APL
Replied to the post instead of the comment! My bad!
PHP
PowerShell
Expanding the ? alias:
Here's one in Dart:
It wasn't as easy as doing a set difference as the
aneeded to keep the duplicate values.Below is the answer in C#.
Whereis the same asfilterin JavaScript.Hey all, Why I don't see any java code here?
Haskell
Another Haskell solution: