Every day on Twitter, I post coding puzzles. These are quick coding challenges that increase in difficulty across the span of the week -- with Monday being the most beginner friendly and Friday being super tough. I love seeing other people's solutions as well, and so people post their solutions as well to the problem in any programming language.
I wanted to try posting these here. I'm going to post each question from this week as a comment below, and then we will thread answers under those questions. Please feel free to post your solutions to the ones you are interested in below! Then, you can comment with insights into people's solutions below that! I will also add a meta thread if you have advice on how to format this in the future!
Excited to see your solutions!
Latest comments (63)
You've got me on a go kick, and now I'm going back and doing previous exercises you've posted! (Sorry for the large volume of comments on your posts today.
Haha there are worse problems out there
the positive integer shouldn't have a leading zero I don't think. It's at least up to interpretation.
true -- I'm on Python 3 though and the test cases are all small
Ah ha. Tuple being a value type, it is better optimized.
Thanks for the tips there 👊
Oh holy shit! I was looking at it for several minutes and it started making sense! Maybe because I thought through problem with @aspittel , or maybe this APL is more sensible (the last one I saw, someone had spilled a bag of unicode across its source).
I'm using Ruby's comment syntax because IDK how to do it in APL
Thanks for the suggestion there, @asparallel.
Here is the updated C# code (with the same logic as JavaScript one) using
.Aggregate
.987654321
is how I expect it to work though without the 0 in the beginning as you should return apositive integer
.I will one day be able to look at APL without my brain leaking out of my ears.
Today is not that day.
Common Lisp FTW!