Setup
Deoxyribonucleic acid (DNA) is a chemical found in the nucleus of cells and carries the "instructions" for the development and fun...
For further actions, you may consider blocking this person and/or reporting abuse
This sounds like a one-liner in JS. Let's see...
As a bonus, any non-DNA letters will be ignored.
i am fresher can you tell me what does this ( => )operator do.
Your help is appreciated.
It’s an arrow function (or anonymous function).
function(a, b) {return a + b;}
Is (almost) the same as:
(a, b) => a + b
There are a few differences but most of the time they aren’t anything to worry about. If you care, this is a good overview: levelup.gitconnected.com/7-differe...
JS:
Ruby keeps on pleasantly surprising me:
Seems like Lua also has a neat solution:
Another javascript solution
JavaScript:
In Python:
C#
---- -|--
- this bit always changes---| ---|
- this bits only changes when---- --|-
is set to 0Haskell:
Returns a Left value if there is a character other than AGTC
Swift solution :
Swift:
I'm trying to complete these everyday for 30 days (hopefully more) - feedback more that welcome here please, thank you! Github PR
Javascript using Map:
PHP:
There is always a better solution, suggest one please - I'm here to learn more .)
OK, I found another one for PHP (7.2 and higher):
Scala