In a football tournament where each pair of teams plays exactly once, the efficiency of a team is calculated as the total goals scored by that team minus the total goals scored by its opponents across all matches. Given the efficiencies of N-1 teams in a tournament with N teams, the efficiency of the missing team can be determined by recognizing that the sum of all team efficiencies must equal zero, because every goal scored by one team is simultaneously a goal conceded by another team. Therefore, the missing team's efficiency equals the negative sum of all other teams' efficiencies.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
12PM in Rome, Italy (Doing Codeforces)Added:
We're officially in Rome, Italy.
The last stop.
And we're going to grind out some leetcode.
It's hot here. I found a random corner.
Show you where I'm at.
I'm literally leetcoding off a random corner.
But I found some shade. It's plus 30°.
I'm hiding I'm hiding out in this random corner.
It's kind of dirty corner, but I mean, it's perfect.
Perfect place for optimal leetcode performance.
Right behind the Colosseum.
And it's hot, so people are just chilling. So, I mean Let's get straight into this. I'm going to grind out some questions and see how it goes from there.
That's the backdrop.
So, how much does Day 2 on a bus It's hot, so I have to just shoot this video and get out of here. That's That's what's going to happen.
Connect to my 5G.
How much does Day 2 on a bus cost? We define an integer to be the most common on a sub subsegment if if its number of occurrences on that subsegment is larger than the number of occurrences of any other integer in that sub subsegment.
A subsegment of an array is uh consecutive segment of elements in the array A.
Given an array A of size N and an integer K, determine if there exists a non-empty subsegment of A where K is the most common element.
We define an integer to be the most common on a subsegment if it's number of occurrences on that subsegment Wait, let me just make sure that it's capturing my screen correctly.
Okay, yeah.
It's like like this.
Perfect.
Let me move my VS code.
We define an integer to be the most common on a subsequence if it's number of occurrences on the sub segment if it's number of occurrences on that subsegment is larger than any other integer.
Given an array of A of size N and integer K, determine if there exists a non-empty subsegment of A where K is the most Okay, let's look at the example.
Man, it's hot.
First line of each test case, N and K.
N number of integers K equals K equals the element we want to be the most common.
Now, you can hear the police here.
If it's If its number of occurrences on that subsegment is larger than any other integer in that subsegment.
So, if we're looking for four, I mean, this is easy.
I think we just need to we just This is a very easy question. We just need to check if K exists.
If K exists, if the element we want is in the array at all?
Yeah, because Yeah, because if it's there, we just if it's any we just use it. Is in the array at all.
I'm going to do some of the easier questions on Codeforces right now, but we're going to get to the hard ones and I don't want to be doing all the hard ones in the middle of the sun like this, so I need a proper setup to actually think those through. So, don't be complaining that oh, you're doing way too easy of a question, but I'm just trying to get get something done.
Some of these questions are harder.
These Codeforces questions are harder than leak code.
You Go check out the weather out here. It's literally plus 30 and burning in the sun.
N K first zero array equals input dot split if K in array print Yes.
else Long session.
Better work.
Let's go.
Oops.
Let's go one down, one down. Look Look at my face. It's like just steaming, but look at this view.
The things I do for y'all. Like honestly, I'm not going to lie to y'all.
This corner that I picked is dirty. It smells bad. It smells awful.
And I'm pulled up here to do this leak code question. Like come on. Drop a like.
Drop a sub just for this.
I'm really I am certified to each and every here. Let me show y'all the view again. I'm going to have to like disinfect everything.
We out here. We out here.
Let me do proper setup.
How long has it been going? All right, we'll run for like 20 more minutes.
Let's do this.
This.
Test test. Hopefully the audio is good cuz I'm only doing this in one take.
A 10 by 10 target is made out of five rings as shown. Each ring has a different point value. The outermost ring one point is the is the next ring. Second is this Okay.
Two points. So, one two.
Vlad fired several arrows at the target.
Help him determine how many points he got. If we could just do multiple test cases. The first line, okay.
Yeah, this is easy as well. Just figure out the row and the column.
Where the row.
Or we can just make a hash map or we can calculate.
What would this be?
If row two Yeah, we can just put a if row column row is the column zero or is there or if it's row zero or column zero or this or that. Like the four cases.
Or yeah.
And then we have like elif condition.
So, if that doesn't match, if it's in two row two If it's in row two, it would have hit this. Okay.
We could We could a bunch of conditions here.
So, the parse this input.
We parse input.
or go So, it's going to be 1 2 3 4 5 6 7 8 10 So, we're just going to parse out the rows.
>> I got to get out of this little corner and ASA Shoot.
What broke?
God.
Taking the biggest shower once I get out of this because I just feel dirty.
This this corner is not the most sanitary corner.
So we're just going to just literally pop out all the conditions for row in range.
What is it? 5? 1 2 3 4 5 10 by 10 10 row column in the range 10 What we're going to do is if row equals 0 or row equals 9 or column equals 0 or column equals 9 if row the row column not equal to X bunch of conditions like that That was bull's eye.
1 2 1 8 1 8 2 7 2 7 3 6 3 6 >> Mali gold beast Mali gold beast mode accepted accepted.
It's time.
Maybe we get like we'll do 6 7 more minutes.
Probably one question because y'all don't understand how bad this corner is.
I wish that I could just actually go live, but I can't.
Rome. This city is honestly very beautiful city though.
I really enjoyed my time at this city.
I'm going to be back in this city.
There's so much things to do. The architecture is beautiful. It's so inspirational.
Like all of the work by the people in the Renaissance like Michelangelo, Raphael, all that stuff. I I was at the Vatican and I seen it. It's just just beautiful.
Super motivational inspirational. So, definitely got to travel more.
See all the art, but I mean, let's get back into this leak code.
Last one.
>> [snorts] >> There are N teams in a football tournament.
Oh, now the sun's like straight up hitting my face.
Yeah, I might have to get out of here soon.
Okay, after after this question.
There are N teams in a football tournament. Each pair of teams match up once. After every match Hack Janek receives two integers as the result of the match. The number of goals the two teams scored during the match.
And this place has is getting me sick.
The whole time I'm like my eyes is itchy and my nose is stuffed. I I thought I was it was cuz of me, but every time it's every time I leave this my my apartment or leave my hotel.
After every match, Max receives two integers as a result. Remember goals of two teams scored in a match. The efficiency of a team is equal to not the number of total Man, hopefully this is easy so we just get out of here.
Each match you get two integers.
Number of goals scored by each team.
Efficiency equals total number of goals minus total goals scored by the opponent in each of its matches.
Turns out he forgot the efficiency of one of the teams. Given the efficiency of n minus one teams, what is the efficiency of the missing team? Oh, it's a math.
You see?
Team one versus team two, one and two.
Okay.
>> Okay.
The first test case What was the possible tournament result?
Team one.
Okay, what are we given though?
I'm going to have to move. The sun's starting to hit my head.
No, we're going to stick it out.
Got to focus up.
What's the efficiency of the missing team?
So, there's going to be four teams.
First line is n equals the number of teams.
Holy.
My nose is getting stuffed by the second while I'm here.
I'm just kidding.
You know I wore my gym shirt.
The efficiency kind of does it need to even out to zero? Yeah, it kind of needs to even out to zero.
Yeah, I think it needs to even out to zero.
Yeah, we just need to add them up.
Holy, I'm getting out of here.
Split.
Um and balance.
Split.
And balance.
Holy.
Side of my face is burning for element input.
No, no, I don't have that.
>> Base 10. Oh yeah, we got to split.
Accepted. All right.
We're done our session.
I took a big hit. I think I literally got sick from just chilling in this corner, but I mean one last I'll take y'all one last little view around the Colosseum.
But we out. Last day of Rome. I'm actually going to go inside there today, but hopefully I didn't get sick, but I'll catch y'all in the next video and I'll be back in San Francisco and we're going to be streaming, making content.
Like and subscribe.
I think I had a great vacation.
I feel like I got got to relax, got to check out, got to see a lot of inspirational stuff.
But other than that, peace.
Related Videos
A Brutal Radical Expression Made Easy! The Shortcut Changes Everything.
tamoshop
112 views•2026-06-02
V : jee main /advance class 11 mathematics : Binomial Theorem class-1 ( 29 may 2026 )
dcamclassesiitjeemainsadva9953
125 views•2026-05-29
Is This Pentomino Tileable?
3cycle
241 views•2026-05-30
This Sudoku Has Many Lines!!
CrackingTheCryptic
2K views•2026-05-29
Olympiad Mathematics | Indian Can You Solve This One?
PhilCoolMath
268 views•2026-06-02
Olympiad Mathematics | Indian | Can You Solve This?
PhilCoolMath
669 views•2026-06-02
Can you get the Correct answer for this Math Quiz?
Fendora01
24K views•2026-05-29
NUMBERBLOCKS COUNT THE TOTAL SUM OF TEN NUMBERS | ADD SMALL TO BIGGEST NUMBER | hello george
hellogeorge2294
5K views•2026-05-28











