Hola hola!
I hope you're doing well, my friends. I had a good week of being (almost fully) offline, in prep for going back to work from maternity leave (!) and closing out October. Let's learn!
Was this forwarded to you? You can subscribe here!
Programming With Less Than Nothing
Importing vs fetching JSON
Solving NYT's Pips Puzzle
React vs. Backbone in 2025
My family and I did a little vacation this week! It was really nice. Since I go back to work next week (!!) it was good to have a "last hurrah" as a little new family of four.
I brought three books on the trip, and read two... pages. Vacationing with two babies is a VERY different experience than traveling as an adult, but not necessarily in a bad way! We were solving the same problems we do at home, but there were less of them. The variety (and sunshine) was good for my brain and I'm really happy we did it, though at the same time I would struggle to recommend flying internationally with a 2.5 year old and a 6 month old, heh. There was a blog post by Rachel Smith that I read a while back about how the family holiday is worth the work/stress/effort, and I can say heartily that she was right.
Unlock Your Career Potential with Keenesse
Feeling stuck, or ready for your next big move?
Keenesse offers personalized career coaching to help you gain crystal-clear career goals, pinpoint exciting advancement opportunities, and master crucial skills like resume optimization, interview mastery, and confident negotiation – all to land your dream role in a competitive market.
Our expert team of seasoned tech industry coaches provides tailored support at every career stage, from ambitious students to accomplished executives.
Ready? Schedule your free, no-obligation consultation today at keenesse.com.
Last week, I had you split up a string into specified widths! Good job Ten, Paul, Ross, Micah, David, Toni, Jeremias, Dave, Amine, George, and Kaartic!
This week's question:
Given a field represented as an array of 0s and 1s, where 1 means that position needs protection, you can place a scarecrow at any index, and each scarecrow protects up to k consecutive positions centered around itself (for example, for k = 3, a scarecrow at i protects i-1, i, and i+1). Return the minimum set of indices where scarecrows should be placed so that all the positions with 1 are protected. You can assume k is an odd number (or make up what happens if it's even).
Examples:
let field = [1, 1, 0, 1, 1, 0, 1];
let k = 3;
placeScarecrows(field, k);
> [1, 4, 6]
placeScarecrows([1, 0, 1, 1, 0, 1], k)
> [1, 4]
placeScarecrows([1, 1, 1, 1, 1], 1)
> [0, 1, 2, 3, 4]
(you can submit your answers by replying to this email with a link to your solution, or share on Bluesky, Twitter, LinkedIn, or Mastodon)
First Shape Found That Can’t Pass Through Itself
Why Stories Make You Smarter Than Self-Help Books
‘Feisty’ Otters Are Once Again Hijacking Surfboards in Santa Cruz
Holy M0lly Guacamole: TKC's Last Hurrah
What do you call someone who knows about marine life?Â
An a-fish-ionado!
That's all for now, folks! Have a great week. Be safe, make good choices, and plan a trip!
Special thanks to Ezell, Ben, Kinetic Labs, Marta, and Flora for supporting my Patreon and this newsletter!
cassidoo
website | blog | github | bluesky | twitter | patreon | twitch | codepen | mastodon