I think a lot of people know this at this point, but I love writing code. To wake myself up in the morning and get my brain running, I normally sol...
For further actions, you may consider blocking this person and/or reporting abuse
Okay, just pipe the number of even terms you want into STDIN (an input of 4 will display the sum of the first 4 even terms of fibonacci) and you're good to go.
Befunge 93:
Kind of disappointed as this solution uses get and put and therefore is less... "fungical"? but trying to do this all on a single stack got away from me.
A Funge++ solution might look more elegant...
Here we go, MUCH happier with this Funge++ solution:
Just to show, Day 3 in C, Time: O(n), Space: O(1), the result is processed in place. Of course, this one only works with ASCII…
Quick subquiz for anyone actually reading this: under what circumstances will this program crash or exhibit undefined behaviour?
Awesome, thanks for sharing. 😁 If you have any interest in learning about bioinformatics (genetics, DNA, inheritance, and the data analysis surrounding it) rosalind.info is a really good site with quite a few puzzles!
These are awesome! Definitely adding them to the rotation
Day 1
Time: O(n), Space: O(n)
Day 2
Time: O(n), Space: O(n)
Day 3
Time: O(n), Space: O(n)
Day 4
Time: O(n), Space: O(1)
Nice exercise, this also shows how clumsy JS is when dealing with string data. Everything has to be converted to and from arrays. And these exercises do not work with non-BMP Unicode characters, but that was not in the requirement ;)
Awesome !
Unfortunately I don't have twitter.. but here are my answers:
Day 1
Day 2
Pretty sure it can be waaaay better
Day 3
Day 4
Day 4 (Project Euler #2) has been already proposed by @peter : dev.to/peter/project-euler-2---eve...
I gave my answer there 🙂
Others here have proposed pretty good solutions for the other three, but my answer to the fourth problem is distinctively different IMO.
Thanks for this, Ali. Another source of good programming puzzles is the Daily Programmer subreddit . The tasks are categorized as easy, intermediate and hard and there is a good discussion on how the solutions can be improved.
It's only JS and really hacky, but I've come to like alf.nu.
Oh awesome! Definitely adding those to the rotation -- I like the RegEx series because I don't like writing them so I should get more practice in!
You can try this one:
codingame.com/servlet/urlinvite?u=...
Add me as a friend!!