In other words, the function should not use an auxiliary array to do the work.
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.)
🧵👇
In other words, the function should not use an auxiliary array to do the work.
Only one of the numbers will appear twice.
There could be more than one value duplicated. You should remove all of them leaving a single copy of the value.
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
You gotta think about this one carefully!
Imagine you go to the doctor and get tested for a rare disease (only 1 in 10,000 people get it.)
The test is 99% effective in detecting both sick and healthy people.
Your test comes back positive.
Are you really sick? Explain below 👇
The most complete answer from every reply so far is from Dr. Lena. Thanks for taking the time and going through
You can get the answer using Bayes' theorem, but let's try to come up with it in a different —maybe more intuitive— way.
👇
Here is what we know:
- Out of 10,000 people, 1 is sick
- Out of 100 sick people, 99 test positive
- Out of 100 healthy people, 99 test negative
Assuming 1 million people take the test (including you):
- 100 of them are sick
- 999,900 of them are healthy
👇
Let's now test both groups, starting with the 100 people sick:
▫️ 99 of them will be diagnosed (correctly) as sick (99%)
▫️ 1 of them is going to be diagnosed (incorrectly) as healthy (1%)
👇
Imagine you go to the doctor and get tested for a rare disease (only 1 in 10,000 people get it.)
The test is 99% effective in detecting both sick and healthy people.
Your test comes back positive.
Are you really sick? Explain below 👇
The most complete answer from every reply so far is from Dr. Lena. Thanks for taking the time and going through
Really doesn\u2019t fit well in a tweet. pic.twitter.com/xN0pAyniFS
— Dr. Lena Sugar \U0001f3f3\ufe0f\u200d\U0001f308\U0001f1ea\U0001f1fa\U0001f1ef\U0001f1f5 (@_jvs) February 18, 2021
You can get the answer using Bayes' theorem, but let's try to come up with it in a different —maybe more intuitive— way.
👇

Here is what we know:
- Out of 10,000 people, 1 is sick
- Out of 100 sick people, 99 test positive
- Out of 100 healthy people, 99 test negative
Assuming 1 million people take the test (including you):
- 100 of them are sick
- 999,900 of them are healthy
👇
Let's now test both groups, starting with the 100 people sick:
▫️ 99 of them will be diagnosed (correctly) as sick (99%)
▫️ 1 of them is going to be diagnosed (incorrectly) as healthy (1%)
👇
More from Tech
The first area to focus on is diversity. This has become a dogma in the tech world, and despite the fact that tech is one of the most meritocratic industries in the world, there are constant efforts to promote diversity at the expense of fairness, merit and competency. Examples:
USC's Interactive Media & Games Division cancels all-star panel that included top-tier game developers who were invited to share their experiences with students. Why? Because there were no women on the
ElectronConf is a conf which chooses presenters based on blind auditions; the identity, gender, and race of the speaker is not known to the selection team. The results of that merit-based approach was an all-male panel. So they cancelled the conference.
Apple's head of diversity (a black woman) got in trouble for promoting a vision of diversity that is at odds with contemporary progressive dogma. (She left the company shortly after this
Also in the name of diversity, there is unabashed discrimination against men (especially white men) in tech, in both hiring policies and in other arenas. One such example is this, a developer workshop that specifically excluded men: https://t.co/N0SkH4hR35
USC's Interactive Media & Games Division cancels all-star panel that included top-tier game developers who were invited to share their experiences with students. Why? Because there were no women on the
ElectronConf is a conf which chooses presenters based on blind auditions; the identity, gender, and race of the speaker is not known to the selection team. The results of that merit-based approach was an all-male panel. So they cancelled the conference.
Apple's head of diversity (a black woman) got in trouble for promoting a vision of diversity that is at odds with contemporary progressive dogma. (She left the company shortly after this
Also in the name of diversity, there is unabashed discrimination against men (especially white men) in tech, in both hiring policies and in other arenas. One such example is this, a developer workshop that specifically excluded men: https://t.co/N0SkH4hR35

The YouTube algorithm that I helped build in 2011 still recommends the flat earth theory by the *hundreds of millions*. This investigation by @RawStory shows some of the real-life consequences of this badly designed AI.
This spring at SxSW, @SusanWojcicki promised "Wikipedia snippets" on debated videos. But they didn't put them on flat earth videos, and instead @YouTube is promoting merchandising such as "NASA lies - Never Trust a Snake". 2/
A few example of flat earth videos that were promoted by YouTube #today:
https://t.co/TumQiX2tlj 3/
https://t.co/uAORIJ5BYX 4/
https://t.co/yOGZ0pLfHG 5/
Flat Earth conference attendees explain how they have been brainwashed by YouTube and Infowarshttps://t.co/gqZwGXPOoc
— Raw Story (@RawStory) November 18, 2018
This spring at SxSW, @SusanWojcicki promised "Wikipedia snippets" on debated videos. But they didn't put them on flat earth videos, and instead @YouTube is promoting merchandising such as "NASA lies - Never Trust a Snake". 2/

A few example of flat earth videos that were promoted by YouTube #today:
https://t.co/TumQiX2tlj 3/
https://t.co/uAORIJ5BYX 4/
https://t.co/yOGZ0pLfHG 5/
So we had to develop technologies like this to barely manage control over limited areas in Iraq's few urban centers. Only ~8 in 100 Iraqi adults owns a personal vehicle. That rate is > 1 car/adult in America yet I have never seen any doctrine paper or work of fiction address this
We've seen and struggled in civil conflicts with instant, local, universal, distributed communications (cell phone era, basically every conflict since 2000). We've seen and struggled in conflicts with instant, global, universal distributed communications (everything since 2011).
The world's most overfunded military and glow in the dark agencies struggle and largely fail to contain conflicts where fhe vast, vast majority of people are locked into a ~5mi radius of their home.
How can they possibly contain a conflict in a nation with universal car ownership and the most developed road network in the world? The average car can travel over 400 miles on one tank of gas, how can you contain the potential of that kind of mobility?
I think that's partially why the system was so freaked out by 1/6. Yes, most of it is histrionics but you don't decide to indefinitely turn your capital into the Baghdad Green Zone with fortifications and 25k troops over histrionics alone.
Hey guys, just a friendly reminder. We're watching you. pic.twitter.com/bGwi1uJBwT
— CIA Metadata Analyst with 8 kids (@CiaKids) September 23, 2019
We've seen and struggled in civil conflicts with instant, local, universal, distributed communications (cell phone era, basically every conflict since 2000). We've seen and struggled in conflicts with instant, global, universal distributed communications (everything since 2011).
The world's most overfunded military and glow in the dark agencies struggle and largely fail to contain conflicts where fhe vast, vast majority of people are locked into a ~5mi radius of their home.
How can they possibly contain a conflict in a nation with universal car ownership and the most developed road network in the world? The average car can travel over 400 miles on one tank of gas, how can you contain the potential of that kind of mobility?
I think that's partially why the system was so freaked out by 1/6. Yes, most of it is histrionics but you don't decide to indefinitely turn your capital into the Baghdad Green Zone with fortifications and 25k troops over histrionics alone.