11 short programming problems to stretch your imagination and make sure you are staying on your toes.

(Starting with the simple ones, they get more fun as you move towards the end.)

🧵👇

1. Write a function that reverses an array in place.

In other words, the function should not use an auxiliary array to do the work.
2. Write a function that finds the missing number in an unsorted array containing every one of the other 99 numbers ranging from 1 to 100.
3. Write a function that finds the duplicate number in an unsorted array containing every number from 1 to 100.

Only one of the numbers will appear twice.
4. Write a function that removes every duplicate value in an array.

There could be more than one value duplicated. You should remove all of them leaving a single copy of the value.
5. Write a function that finds the largest and smallest number in an unsorted array.
6. Write a function that finds a subarray whose sum is equal to a given value.
7. Write a function that finds the contiguous subarray of a given size with the largest sum.
8. Write a function that, given two arrays, finds the longest common subarray present in both of them.
9. Write a function that, given two arrays, finds the length of the shortest array that contains both input arrays as subarrays.
10. Write a function that, given an array, determines if you can partition it in two separate subarrays such that the sum of elements in both subarrays is the same.
11. Write a function that, given an array, divides it into two subarrays, such as the absolute difference between their sums is minimum.
I'd love to see some answers!

If you want more content on software engineering, machine learning, and adjacent topics, give me a follow. I post threads like this every week. You can enjoy more of this content here: @svpino.

More from Santiago

10 machine learning YouTube videos.

On libraries, algorithms, and tools.

(If you want to start with machine learning, having a comprehensive set of hands-on tutorials you can always refer to is fundamental.)

🧵👇

1⃣ Notebooks are a fantastic way to code, experiment, and communicate your results.

Take a look at @CoreyMSchafer's fantastic 30-minute tutorial on Jupyter Notebooks.

https://t.co/HqE9yt8TkB


2⃣ The Pandas library is the gold-standard to manipulate structured data.

Check out @joejamesusa's "Pandas Tutorial. Intro to DataFrames."

https://t.co/aOLh0dcGF5


3⃣ Data visualization is key for anyone practicing machine learning.

Check out @blondiebytes's "Learn Matplotlib in 6 minutes" tutorial.

https://t.co/QxjsODI1HB


4⃣ Another trendy data visualization library is Seaborn.

@NewThinkTank put together "Seaborn Tutorial 2020," which I highly recommend.

https://t.co/eAU5NBucbm

More from Tech

Next.js has taken the web dev world by storm

It’s the @reactjs framework devs rave about praising its power, flexibility, and dev experience

Don't feel like you're missing out!

Here's everything you need to know in 10 tweets

Let’s dive in 🧵


Next.js is a @reactjs framework from @vercel

It couples a great dev experience with an opinionated feature set to make it easy to spin up new performant, dynamic web apps

It's used by many high-profile teams like @hulu, @apple, @Nike, & more

https://t.co/whCdm5ytuk


@vercel @hulu @Apple @Nike The team at @vercel, formerly Zeit, originally and launched v1 of the framework on Oct 26, 2016 in the pursuit of universal JavaScript apps

Since then, the team & community has grown expotentially, including contributions from giants like @Google

https://t.co/xPPTOtHoKW


@vercel @hulu @Apple @Nike @Google In the #jamstack world, Next.js pulled a hefty 58.6% share of framework adoption in 2020

Compared to other popular @reactjs frameworks like Gatsby, which pulled in 12%

*The Next.js stats likely include some SSR, arguably not Jamstack

https://t.co/acNawfcM4z


@vercel @hulu @Apple @Nike @Google The easiest way to get started with a new Next.js app is with Create Next App

Simply run:

yarn create next-app

or

npx create-next-app

You can even start from a git-based template with the -e flag

yarn create next-app -e https://t.co/JMQ87gi1ue

https://t.co/rwKhp7zlys

You May Also Like

I hate when I learn something new (to me) & stunning about the Jeff Epstein network (h/t MoodyKnowsNada.)

Where to begin?

So our new Secretary of State Anthony Blinken's stepfather, Samuel Pisar, was "longtime lawyer and confidant of...Robert Maxwell," Ghislaine Maxwell's Dad.


"Pisar was one of the last people to speak to Maxwell, by phone, probably an hour before the chairman of Mirror Group Newspapers fell off his luxury yacht the Lady Ghislaine on 5 November, 1991."
https://t.co/DAEgchNyTP


OK, so that's just a coincidence. Moving on, Anthony Blinken "attended the prestigious Dalton School in New York City"...wait, what? https://t.co/DnE6AvHmJg

Dalton School...Dalton School...rings a

Oh that's right.

The dad of the U.S. Attorney General under both George W. Bush & Donald Trump, William Barr, was headmaster of the Dalton School.

Donald Barr was also quite a


I'm not going to even mention that Blinken's stepdad Sam Pisar's name was in Epstein's "black book."

Lots of names in that book. I mean, for example, Cuomo, Trump, Clinton, Prince Andrew, Bill Cosby, Woody Allen - all in that book, and their reputations are spotless.
The entire discussion around Facebook’s disclosures of what happened in 2016 is very frustrating. No exec stopped any investigations, but there were a lot of heated discussions about what to publish and when.


In the spring and summer of 2016, as reported by the Times, activity we traced to GRU was reported to the FBI. This was the standard model of interaction companies used for nation-state attacks against likely US targeted.

In the Spring of 2017, after a deep dive into the Fake News phenomena, the security team wanted to publish an update that covered what we had learned. At this point, we didn’t have any advertising content or the big IRA cluster, but we did know about the GRU model.

This report when through dozens of edits as different equities were represented. I did not have any meetings with Sheryl on the paper, but I can’t speak to whether she was in the loop with my higher-ups.

In the end, the difficult question of attribution was settled by us pointing to the DNI report instead of saying Russia or GRU directly. In my pre-briefs with members of Congress, I made it clear that we believed this action was GRU.