Hey friends!
I hope you had a good Pi Day week! Let's 3.14159 our way through the iiiiinternet!
Was this forwarded to you? You can subscribe here!
I tried Blurring things in Quirky ways
The perils of using double quotes "" inside an alt attribute text value
How HEAD works in Git
Winning a hackathon, losing my sanity
I recently bought a simple point and shoot camera! I got it for taking baby pictures and just day-to-day pictures (so I don't have to take my phone out all the time), and it's been really fun to play with!
It feels very old school, reminding me of playing with the 2007 PowerShot camera back when our phones were dumber and our computers were slower. It's made me feel a bit more intentional about taking photos, and I already have evolved into a snob comparing the camera pictures to the ones my phone takes.
Scalar: Beautiful Open-Source API References from Swagger/OpenAPI files ✨
Try it out today at github.com/scalar/scalar
Last week, I had you find a gap between numbers in a sorted array! There were a ton of really cool and different answers! Awesome work Miguel, Nathael, Arban, Alexandra, Pedro, Amine, Sean, Ifeanyi, Maciej, Kyle, Carlos, Leo, Neil, Amir, Saad, Ben, Angelo, Faus, Pablo, Sebas, Ten, Ryan, Alison, Chase, Manuel, Amar, Damo, Agustin, and Goncy!
This week's question:
Given an integer array, write a function hills(arr)
and a function valleys(arr)
that return the number of hills and valleys, respectively, in the array. The integers represent heights!
Example:
let arr = [1,2,1]
hills(arr) // returns 1
valleys(arr) // returns 0
arr = [1,0,1]
hills(arr) // returns 0
valleys(arr) // returns 1
arr = [7,6,5,5,4,1]
hills(arr) // returns 0
valleys(arr) // returns 0
arr = [3,4,1,1,6,5]
hills(arr) // returns 2
valleys(arr) // returns 1
(you can submit your answers by replying to this email with a link to your solution, or share on LinkedIn, Twitter, Mastodon, or Bluesky)
Tanya's favorite math jokes
How Engineers Straightened the Leaning Tower of Pisa
Geistmaschine Geist TE keyboard
On the dangers of sleep
Dermatologists are always in a hurry.
They spend all day making rash decisions!
That's all for now, folks! Have a great week. Be safe, make good choices, and back up your important photos!
Special thanks to IceSloth, Ezell, Sebastián, Ben, and Kinetic Labs for supporting my Patreon and this newsletter!
cassidoo
website | blog | github | twitter | patreon | twitch | codepen | mastodon | bluesky