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

These past few days I've been experimenting with something new that I want to use by myself.

Interestingly, this thread below has been written by that.

Let me show you how it looks like. 👇🏻


When you see localhost up there, you should know that it's truly an experiment! 😀


It's a dead-simple thread writer that will post a series of tweets a.k.a tweetstorm. ⚡️

I've been personally wanting it myself since few months ago, but neglected it intentionally to make sure it's something that I genuinely need.

So why is that important for me? 🙂

I've been a believer of a story. I tell stories all the time, whether it's in the real world or online like this. Our society has moved by that.

If you're interested by stories that move us, read Sapiens!

One of the stories that I've told was from the launch of Poster.

It's been launched multiple times this year, and Twitter has been my go-to place to tell the world about that.

Here comes my frustration.. 😤
What an amazing presentation! Loved how @ravidharamshi77 brilliantly started off with global macros & capital markets, and then gradually migrated to Indian equities, summing up his thesis for a bull market case!

@MadhusudanKela @VQIndia @sameervq

My key learnings: ⬇️⬇️⬇️


First, the BEAR case:

1. Bitcoin has surpassed all the bubbles of the last 45 years in extent that includes Gold, Nikkei, dotcom bubble.

2. Cyclically adjusted PE ratio for S&P 500 almost at 1929 (The Great Depression) peaks, at highest levels except the dotcom crisis in 2000.

3. World market cap to GDP ratio presently at 124% vs last 5 years average of 92% & last 10 years average of 85%.
US market cap to GDP nearing 200%.

4. Bitcoin (as an asset class) has moved to the 3rd place in terms of price gains in preceding 3 years before peak (900%); 1st was Tulip bubble in 17th century (rising 2200%).

You May Also Like

This is a pretty valiant attempt to defend the "Feminist Glaciology" article, which says conventional wisdom is wrong, and this is a solid piece of scholarship. I'll beg to differ, because I think Jeffery, here, is confusing scholarship with "saying things that seem right".


The article is, at heart, deeply weird, even essentialist. Here, for example, is the claim that proposing climate engineering is a "man" thing. Also a "man" thing: attempting to get distance from a topic, approaching it in a disinterested fashion.


Also a "man" thing—physical courage. (I guess, not quite: physical courage "co-constitutes" masculinist glaciology along with nationalism and colonialism.)


There's criticism of a New York Times article that talks about glaciology adventures, which makes a similar point.


At the heart of this chunk is the claim that glaciology excludes women because of a narrative of scientific objectivity and physical adventure. This is a strong claim! It's not enough to say, hey, sure, sounds good. Is it true?