Wascally Wabbits

Olga Rosas
5 min readJun 2, 2020

--

Something fabulous just happened! I mentioned here that I (belatedly) joined the Puerto Rico Summer Coding Challenge, or PRSCC.

I received notice from a friend that this competition was happening as early as May 13th, but I first wanted to wait until my role as Homeschooler in Chief was done. Right now, a week after the end of most-traumatic-events (aka trynna impart knowledge to tiny humans), I finally feel I’m (almost) able to put two thoughts together. So instead of two months to complete the challenges, I’ll have about five weeks. But now, a flashback:

It will come as no surprise to most, dear readers, that I’ve been a bit-of-a-nerd throughout my life. In high school, for example, I was Vice President of the Math Club. It goes further still; Physical Education actually lowered my GPA all years it was required in the curriculum. I’m not proud of that. I wasn’t exactly unfit, since I had been taking ballet since age 9 or 10. I was just generally uncoordinated, with overall difficulties in areas requiring gross motor skills, and hand-eye coordination. I was also pretty afraid to get hit by a ball.

So fast-forward almost 10 years since Ms. Concepción gave me that last B- (for being unable to pass the ball over the Volleyball net more times than I left it on my side of the court), whilst working at The Metropolitan Museum of Art, I jumped at the opportunity to join the Softball Team. I had never been on any sort of athletic team, nor was I over my fear of balls, but this was a fantastic chance to meet and mingle with people outside the Membership Department. The team was mostly made up of Security guys and gals, with a few other groups represented as well.

A lot of memories are fuzzy from way back then but I remember going to the Modell’s in the Upper East Side, near The Met, choosing a glove and breaking it in all by myself. I bought some oil made just for this purpose, rubber bands, and a softball, of course. This is “a process that is really quite precise,” one I later learned has been perfectly captured in a song from a Tony-award winning musical, Dear Evan Hansen.

One of many excellent songs in this Broadway musical

But what I remember most is that at one of the games (we played against other teams in the city), while standing deep in Right Field, the batter hit a ball in my direction. As I watched this in slow-motion, I kept repeating three things in my mind: 1- I’m not afraid of the ball, 2- I will catch the ball that comes my way, and 3- I will NOT drop the ball. And when I did, catch the ball that is, my teammates started to scream my name and jump up and down with exuberance. I do not exaggerate when I say it was one of the best moments of my life: there’s having my kids and this, and all the rest of the good things that have happened to me throughout the years. 😜

The celebration was short-lived as the ball was still “alive” and I was now being told to throw it back; thankfully, the short-stop ran towards me and I managed to efficiently get the ball to him. Here’s hard core evidence:

The Met’s Softball Team, a thousand years ago

Anyways, back to the present: last week, I felt I was breezing through the initial questions of the PRSCC, until I realized what I was answering were warm-ups meant to acclimate competitors to Python and the overall process of problem-solving. This section was called Python Village. After getting trained in the Village, I hit one of the main branches in the competition and still felt comfortable enough until I opened the Wascally Wabbits challenge. The problem was this:

I was familiar with the algorithm that created a Fibonacci sequence where after the first two entries of 0, and 1, subsequent numbers were made up by adding the two previous ones. (Un)interesting trivia: I think I first heard about Fibonacci reading The DaVinci Code, and then again when I watched the film adaptation of the book with Tom Hanks. Then, at bootcamp, a couple of my cohort-mates were really into Math and CS, so they presented blogposts on solving this Fibonacci algorithm, and finally, in my Udemy Course with Stephen Grider, it popped up again so I knew how to solve this problem in JavaScript, both iteratively and recursively.

But this new Fib-problem was asking for how many pairs of rabbits there will be after n months given a litter size of k pairs. Not a completely different ballgame altogether but dissimilar enough that it took me most of the afternoon of day 1, some processing in my sleep, and about one more hour the next morning. But when I cracked it, whoa, I remembered that feeling of catching the ball, and being a hero. The only thing that made me slightly unhappy is that there was no-one around and I couldn’t celebrate properly. I sent some text messages to the few people who might understand this was a big deal for me. And that was that. Here’s my solution, in Python, saved forever on my Jupyter notebook and my GitHub account:

Surprisingly succinct

--

--