@@TranquilityVast I mean if you can name the some of most notorious programmer they definitely not spend time grinding Leetcode, Linux is an example, they enjoy CP and math and do it some other times but not spend time grinding for nothing like this.
@@Gbyrd99 was going to suggest the same thing. It's even sponsored by Microsoft and has a lot of Starcraft based questions. Nerdiest shit ever, and I do both programming and Excel 😂
Its working wrong in India by displaying Anti Modi Government reels ,videos of German Indian boy who omiting only poison against Hindu culture ,Indian government ..Lmao..Google also interfering in elction of India as comand of USA
WE NEED WORLD CHAMPIONSHIPS , ADD DRAFT PICKS ADD PROGRAMMING LANGUAGE BANS, ADD DATA STRUCTURE BANS, ADD 2 vs 2 WE NEED MOREEEE THIS IS WAY BETTER THAN ESPORTS
@@uknown2031 pyhton probably, cuz it just gives shorter code same logic advantage haha. Also, that would be such a curve ball for people who don't even bother to try any other language than Python lmao 🤣
Add pre-built function usage bans, s.t. mathematically sound and efficient solutions become more relevant, oops, and by it remove 95% of possible competitors from a potential base of players. 😂
Great idea but really needs some work on the execution, for example: -Some of the problems would benefit from a brief code review at the end, rather than cutting straight to the hosts without reflecting at all on the differences in code or approach between the contestants. Even just a 15 second comparative review would be better than cutting to filler talk. -why interview the loser asking them 'if they have anything to say', instead of interviewing the winner about their successful approach? -at the end of the round when it cuts back to the hosts, the competitor info on the screen is obscured Keep it up and looking forward to seeing the next incarnation of the contest.
@@HackSussex Really cool idea, I think it would be a better to put up a veteran knowledgeable coder as the judge, so that they analyse the competitor approach instead of these guys just putting up a voice over of what they are implementing. Imagine Ken thompson on the show judging the finals. Would be a good PR as well.
@@3xpl0i79 hi that would be a great idea but the show is run by students at Sussex, we like to give out committee members the opportunity to present the coders’ cup!
For R2-G1: You can simply sum all of them and divide by 2 return the int (rounded down) if one of the inputs is not greater than the sum of two others. If so return the sum of two minimum inputs. And if any of the inputs is zero, return min non-zero input.
When I found this on my RUclips recommendation, licked the video automatically, then subscribed with no hesitation. I am an Esports fan on most games but this, as a self-taught programmer, I love this more than anything else. Makes my brain analyze more than in games with strategy, but those are still good and fine, they were made for what they are. But this, this is what I want.
For some reason this has something nostalgic, as if its from 20 years ago! So epic though, the passion, the awkwardness, the joy. Wish I was part of that community.
The commentators are actually the best part of this event. Good analysis, banter, and personality. Keep these events going Sussex. From across the pond
I love the fact that Layton was so humble. He even expressed his disapproval in the way the speaker spoke to Patric. His face expression when he said “That was brutal” was funny but genuine. Awesome! You truly are the best coder of Sussex, Layton. Great job to the whole team. We need more nerdy competition like this. Love from Nigeria ❤
57:47 step 1 : function GetSquares from rectangles => step 2: function from list output for step 1 => select distric value => find maxvalue=> count value => step 3: combine all step in code. Right or not?
33:37 For this question R1-G2 We can first calculate the sum of n numbers using formula and use for loops to check each row is equal to that sum , if it is not equal we can return it on that condition
That would expose you to the cases where sum(1 to n) can equal the correct sum, but not contain the required [1 to n]. For example sum of [1,2,3] = 6, but sum of [1,1,4] is also 6. Thus not a valid row.
I'd love to try these myself.... watch the competition, pause as contestants start a round, try doing it myself, then either get my own time, or give up, then continue watching; seeing how the contestants did it..... would love it if I could download the testcases 😁
I thank youtube algorithm for this recommendation, especially events like this with well educated and peoples that have the same passion as me, for me to learn from you guys. KEEP UP THE GOOD WORK!!!!!!!❤❤
I was excited sitting there during the final questions. Both because of the tension of the contestants writing the algorithm flow, "I know this but I can't write it right now", and because I said I know these questions and can solve them (or I did) while they were coding. It was a truly mind-opening experience, watching the video.
When I saw Layton solve problem 1, I thought he was a genius and that the competition must have truly attracted the best of the best. Then when I saw the competitors struggle on the second and third problem I knew Layton would win the competition by a big margin.
Bruh, specially on the third problem, I got the solution almost immediatly, continued with other things i was doing, and when i came back they still were starting at the blank screen hahaha.
It's kinda nuts. Coding a solution you have a lifetime to learn but understanding the problem is in you from the start. I hope a lot of these people end up making websites.
For Game 2, maximize the set and list funtionalities def solution(matrix: list[list[int]]) -> bool: dimension = len(matrix) checked_nums = set(list(range(1, (dimension + 1)))) for i in range(dimension): if not set(matrix[i]) == checked_nums: return False
You don't need *list* in between *set* and *range* in your _checked_nums_ variable. But very solid solution! Better than the one I came up with when I tried before the video.
in second question we can use hashmap and store frequency of every element out there ultimately the frequency of each element has to be equal to n(target) which is square matrix. if the frequency equals to n then return true otherwise false. 3rd question again we use hashmap and store the indices of the characters of first string. then iterate over the second string and match the indices . if the indices are different swap it and check if they are equal or not.
I've never coded in python but I had an idea for the second problem (checking if all columns and rows of nxn Matrix has all numbers): Sort all the rows, then break and return false if on the i-th column there is a number != i, otherwise return true. explanation: if all column have all numbers between 1 and n, then after ordering them, the element at the first index would be 1 and the last would be n and everything in between is ordered. So the problem boils down to writing the easiest ordering function of a list that you can, stick it in a for loop to order all lists, then check with a while or for loop the if the List[i] = i+1
matix = [[1,2,3],[2, 3, 4],[1, 2, 3],[2, 3, 4]] rows = len(matix) colums = len(matix[0]) flag = True for i in range(len(matix)): row = matix[i] for val in row: if val > max(rows, colums): flag = False print(flag)
R2 - G1 can be done with a simple comparison im sure: You have 3 values: find the largest value if the sum of the 2 smaller values is less than the larger, return this. else return the largest value. eg if(a+b < c) return a+b else return c
currently watching this and its so interesting !!!!.. for the round between bramble and jo , i think i would have first converted the matrix of lists into two matrixes (one for rows , one for cols) and then loop though each one ,to get my answer
I just started programming and learning the basics but am enjoying this for some reason even tho I don't understand what's going on wish me luck in my jouney dear programmers .
fun recursion for the 5th task. def solution(a,b,c): ls = sorted([a,b,c]) a = ls[-1] - 1 b = ls[1] - 1 c = ls[0] ls = sorted([a,b,c]) if ls[0] + ls[1] == 0: return 1 return 1 + solution(a, b, c )
The commentator picking on Layton saying "I don't think he understands the problem yet, I'm sure he doesn't want to write hundreds of numbers!" clearly did not understand it either lol.
Jacopo's solution on R1-G3 is wrong if we take two strings having same alphabets, but different in counts. Eg: s1="aaab", s2="abbb". Here, if we use set to store all alphabets of s1, s2; then we get {a,b}. Difference in positions of characters is two, so Jacopo's solution would return True. But in reality, it's False as s1 has three a's, s2 has three b's. So, we need to take a bit-array or hashmap to store characters and their counts for each string separately, then compare the occurrences for each character.
1st condition: return false if strings have not same number of characters 2nd condition: return false if there are more than 1 character mismatch otherwise just return true
Yes, you are right. Jacopo's solution is not working on certain cases. But, I think, the approach you mentioned that to store characters and their counts for each string separately, then compare the occurrences for each character, will also fail if s1="abba" and s2="abab". If we match the difference in position of characters then it may work. But in my opinion it's better to create a new string from s2 with swapping and compare with s1.
@@sohantirpude2455i am storing index and since the two strings should have been equal means, the index of alpha should be the same, if it isn't we will swap. in leetcode it's called as buddy strings unordered_mapm; for(int i=0;i
In the second problem, can't we just use Sn = (n*(n+1))/2 formula? (Sn = sum of first n integers starting from 1) Basically, what I thought is, just calculate the running sum of each row, then compare it with the Sn, if answer is not equal to Sn then simply return false. Else go forward. This solution might look good but there might be some bug in this, like what if the row is [6, -6, 6], the row sum is valid, but it does not have all the integers.
Watching bramble get stun locked on that question was brutal. He managed to cobble together something and was frozen solid for a good 10m. It was interesting to see. The sorting was a trap because if it's a matrix you cannot restructure it. Easiest way to do this generate two sets. One of the original array, the other with the appropriate element in each one. And then check length and voila
yes he sorted matrix for row-wise checking,so matrix distorted it is not same coloumn wise checking, My approach to solve that question is first calculate xor of all elements from 1 to n , now create a array for row and one for col and fill them with xor intially , now there is a property of xor - same number xor is always 0,so if ith row contains all numbers from 1 to n then (1 to n) xor (ith row xor) must be 0 , same for col int xor = 0; for(int i=0;i
Increible!! yo recién en la universidad he empezado en el mundo de la programación competitiva y siempre uso C++ para las soluciones. Muy interesante lo que han presentado y felicidades a todos los participantes.
Sum To 100 is not correctly solved and the test should have failed or am I wrong? The task says "You have the numbers from 1 to 10 in order [...] You may also concatenate digits, however they must remain in the original order [...]". Layton's line does not include all numbers from 1 to 10 in an order. Example 2 is also wrong, because digit "10" is separated by the symbol * (0 is not included in the given order) and how the heck shall I receive two 5s by inserting symbols?
This is my first time watching this contest........correct me If I am missing something.....but I think the questions are not that difficult....Can someone please give me a rating of these questions in terms of Codeforces .....it would be really helpful for me to compare.
1:22:00 (Layton's solution for semifinal round) does it work if a,b,c = 3,3,3? his code returns 3 but we can get 4 (more optimal) if we do as follows: starting at 333: 322->212->111->001 or am i missing sth? would be great if somebody explained. thank you edit: my bad i forgot the sorted() on the line l = sorted([i for i in l if i > 0]) in the while loop. Layton's solution is superb
Well.. for the question about ROCKS and PILES..i have a different kinda solution..that could give the correct answer..and it goes like this: make a list list1 of sorted a, b,and c. and another list list2 of sorted (a,b,c-a). Then find the min of list1 and list2 & add both of them That should give you the no. of moves required !! Anyways..Thanks for such great videos!!
I don't understand how "return 1 + 2 + 3 + 4 + 9 * 10" was accepted as a solution. According to my understanding and the examples provided, all numbers from 1 to 10 must be included in the solution. If "return 1 + 2 + 3 + 4 + 9 * 10" worked, then a simple "return 2 * 5 * 10" should have worked too, right? I assume "return 100" would have solved the problem as well... Or was it accepted because of the poor wording, since it doesn't say "you must use each digit exactly once"?
This is awesome! Question, for Jacopo and Kei's challenge, could you not just multiply the ASCII character values from each string together and then check if the product of both strings are equal? That would mean that they both have the same characters in them, which would need to be the case in order to do a character swap.
loved watching this. It's educational and entertaining. please continue on, on your awesome show Only few things I think would improve this, Move that TV behind you guys a little higher so the informations are not blocked by your shoulder. Also when either coder won, run through their code real quick. And lastly maybe position the coders a little better so the introducer is not awkwardly standing and blocking them after introducing them (it's just a tiny change that would improve it in my opinion) Everything else is perfect can't wait for the next videos
your creative teams make great inspiring fire and motivation to us who like create logic shapes. you can grow to meet big effect to code and logic creators. try continue be fire and inspiring . i subscribed
for third question, just having same characters in both the strings is enough as when we have same characters, no matter in what way they are ordered, we can always arrange them correctly by successively swapping unordered characters
The world needs more competitions like this
Indeed, well said.
No it's not, why not built some useful application for society instead of grinding leetcode for nothing.
@@strawberryblender make useful application (in hours) don't reflect complete intelligent of human
@@TranquilityVast I mean if you can name the some of most notorious programmer they definitely not spend time grinding Leetcode, Linux is an example, they enjoy CP and math and do it some other times but not spend time grinding for nothing like this.
Indeed...
Literally the nerdiest competition ever and I'm here for it.
hahahahah
You need to watch the excel world championship. That is a sight to behold and super nerdy
@@Gbyrd99 was going to suggest the same thing. It's even sponsored by Microsoft and has a lot of Starcraft based questions. Nerdiest shit ever, and I do both programming and Excel 😂
@@Soulful_Oatmilk haven't used excel in a very Long time. Using sheets and sc2 but man it's so incredible watching the world championships
You also need to see Geoguessr tournament
I got blessed by RUclips's Recommendation algorithm.. never seen something like this, and i hope there will be more like this in the future
Its working wrong in India by displaying Anti Modi Government reels ,videos of German Indian boy who omiting only poison against Hindu culture ,Indian government ..Lmao..Google also interfering in elction of India as comand of USA
Same here, I got so into the first puzzle, I paused the video, ran to the computer to attempt it. Managed to brute force something in about 10m
SAME HERE!!!!
Same here.
Me too, but I was kind a sad about the solutions of the developers to be honest. Anyway.
This competition needs to be qualified as an esport event
u have a bottle as a rival
COYS
@@Kyle-mo7yp couldnt even draw with city🚮.. lol jk
@@JeanCS-ut2qz bottlers
@@Kyle-mo7yp lol was just joking ..good luck next season xD
WE NEED WORLD CHAMPIONSHIPS , ADD DRAFT PICKS ADD PROGRAMMING LANGUAGE BANS, ADD DATA STRUCTURE BANS, ADD 2 vs 2 WE NEED MOREEEE THIS IS WAY BETTER THAN ESPORTS
yo thats actually some pretty good ideas, imagine 2v2s
@@abdullahihilowle3117 we got roles now babyyy. The Mind Carry / The Keyboard Marksmen.
What a programming language must banned from competition?
@@uknown2031 pyhton probably, cuz it just gives shorter code same logic advantage haha. Also, that would be such a curve ball for people who don't even bother to try any other language than Python lmao 🤣
Add pre-built function usage bans, s.t. mathematically sound and efficient solutions become more relevant, oops, and by it remove 95% of possible competitors from a potential base of players. 😂
I like that the competitors aren't some super geniuses but just the local nerds, which makes this a lot more relatable lol
have you seen "the tourist" competing? I feel like a snail :')
its part of a university society
competitive programming feels like a fever dream to me
isn't complicated as you think.
it's not a coplex
@@octaviusp teach me
@@PinkeySuavoIf you ever get stuck.. throw a hashmap at the problem and you'll be fine
@@Thomas-dp8ebthis isnt competitive programming iirc
Great idea but really needs some work on the execution, for example:
-Some of the problems would benefit from a brief code review at the end, rather than cutting straight to the hosts without reflecting at all on the differences in code or approach between the contestants. Even just a 15 second comparative review would be better than cutting to filler talk.
-why interview the loser asking them 'if they have anything to say', instead of interviewing the winner about their successful approach?
-at the end of the round when it cuts back to the hosts, the competitor info on the screen is obscured
Keep it up and looking forward to seeing the next incarnation of the contest.
Hi thanks for the amazing feedback, we will take it on board and try implement them in our next coders’ cup 👍🏻
@@HackSussex Really cool idea, I think it would be a better to put up a veteran knowledgeable coder as the judge, so that they analyse the competitor approach instead of these guys just putting up a voice over of what they are implementing.
Imagine Ken thompson on the show judging the finals. Would be a good PR as well.
@@3xpl0i79 hi that would be a great idea but the show is run by students at Sussex, we like to give out committee members the opportunity to present the coders’ cup!
Would be cool to have the “passed tests” displayed on screen too. Keep up that tension, like a score in a sport.
I also want to hear the thoughts of the competitors after each round, were they nervous or something haha
I love how the caster talk about the competitors write the code. LOL.
I used to hear e-sport caster
But this is the next level. LOL
For R2-G1: You can simply sum all of them and divide by 2 return the int (rounded down) if one of the inputs is not greater than the sum of two others. If so return the sum of two minimum inputs. And if any of the inputs is zero, return min non-zero input.
yeah i honestly didn't think they were that experienced of python coders.
yes, and the math guy got nervous maybe, so he forgot to visualize and calculate first :D
@@resresres1
Kinda wild how some of them have "experience" of 5+ years, when their speed and quality looks like 2nd semester students
When I found this on my RUclips recommendation, licked the video automatically, then subscribed with no hesitation. I am an Esports fan on most games but this, as a self-taught programmer, I love this more than anything else. Makes my brain analyze more than in games with strategy, but those are still good and fine, they were made for what they are. But this, this is what I want.
How did the video taste?
@@MA-jz4yc he lick it good 😅🤣
ayo licking the video?
Great Competition and great comments ! Thank you guys !
For some reason this has something nostalgic, as if its from 20 years ago!
So epic though, the passion, the awkwardness, the joy. Wish I was part of that community.
The commentators are actually the best part of this event. Good analysis, banter, and personality. Keep these events going Sussex. From across the pond
Are you fucking kidding me?
@@kyugreywolf6801 totally
@@kyugreywolf6801 🤣🤣🤣
we need more of this. i am pretty sure the production level will go up exponentially in coming years. happy to see some fresh content
I love the fact that Layton was so humble. He even expressed his disapproval in the way the speaker spoke to Patric. His face expression when he said “That was brutal” was funny but genuine.
Awesome! You truly are the best coder of Sussex, Layton.
Great job to the whole team. We need more nerdy competition like this.
Love from Nigeria ❤
Senegalese like me see this competition with joy and good humor. It is a first for me, a revelation that allows us to make the world a better place.
This was actually enjoyable and as a viewer, it's great seeing how others problem solve. Thanks!!!!
57:47 step 1 : function GetSquares from rectangles => step 2: function from list output for step 1 => select distric value => find maxvalue=> count value => step 3: combine all step in code.
Right or not?
33:37 For this question R1-G2
We can first calculate the sum of n numbers using formula and use for loops to check each row is equal to that sum , if it is not equal we can return it on that condition
That would expose you to the cases where sum(1 to n) can equal the correct sum, but not contain the required [1 to n]. For example sum of [1,2,3] = 6, but sum of [1,1,4] is also 6. Thus not a valid row.
@@alvaroflores4371 yeah u r right 👍
@@alvaroflores4371 int n = matrix.size();
set s1;
set s2;
for(int i=0;i
Just cache a set of values from 1 to n and compare each row and each column with aforementioned set
I asked myself why this isn't a thing. Now I know it is a thing. Love it, more of it!
I'd love to try these myself.... watch the competition, pause as contestants start a round, try doing it myself, then either get my own time, or give up, then continue watching; seeing how the contestants did it..... would love it if I could download the testcases 😁
im still trying without but yeah they dropped the ball hard not providing those..
@@yeetdatcodeboi all problems are on leetcode,, they have a good range of test cases over there
I don't even understand the assignment but I am still cheering for them
I really enjoyed watching this. Kudos to the people behind this competition, Good job
This is gold....needs billion views
All thanks to the algorithm for this gem
I thank youtube algorithm for this recommendation, especially events like this with well educated and peoples that have the same passion as me, for me to learn from you guys. KEEP UP THE GOOD WORK!!!!!!!❤❤
I was excited sitting there during the final questions. Both because of the tension of the contestants writing the algorithm flow, "I know this but I can't write it right now", and because I said I know these questions and can solve them (or I did) while they were coding. It was a truly mind-opening experience, watching the video.
I like the way commentators explaining the algo..........bro it seems like a football match :) loving it... we want more of this
When I saw Layton solve problem 1, I thought he was a genius and that the competition must have truly attracted the best of the best. Then when I saw the competitors struggle on the second and third problem I knew Layton would win the competition by a big margin.
Bruh, specially on the third problem, I got the solution almost immediatly, continued with other things i was doing, and when i came back they still were starting at the blank screen hahaha.
It's kinda nuts. Coding a solution you have a lifetime to learn but understanding the problem is in you from the start.
I hope a lot of these people end up making websites.
The moment layton started coding at the start i knew he is the real deal
To be honest, I solved the first problem about 1 minute before Layton was done using another method of two list comprehensions
Haha thats right. These problems are ridiculous... imagine not getting laid and being unable to use a nested loop hahaha
For Game 2, maximize the set and list funtionalities
def solution(matrix: list[list[int]]) -> bool:
dimension = len(matrix)
checked_nums = set(list(range(1, (dimension + 1))))
for i in range(dimension):
if not set(matrix[i]) == checked_nums:
return False
return True
You don't need *list* in between *set* and *range* in your _checked_nums_ variable. But very solid solution! Better than the one I came up with when I tried before the video.
what about columns?
in second question we can use hashmap and store frequency of every element out there ultimately the frequency of each element has to be equal to n(target) which is square matrix. if the frequency equals to n then return true otherwise false. 3rd question again we use hashmap and store the indices of the characters of first string. then iterate over the second string and match the indices . if the indices are different swap it and check if they are equal or not.
Don't these problems seem too easy?
@@rajagrawal6758 some of them are actually. thing is they should atleast come with brute force quickly. but they didn't
@@kumarashutosh-p3n True it's weird how they gave trivial problems.
I've never coded in python but I had an idea for the second problem (checking if all columns and rows of nxn Matrix has all numbers):
Sort all the rows, then break and return false if on the i-th column there is a number != i, otherwise return true.
explanation: if all column have all numbers between 1 and n, then after ordering them, the element at the first index would be 1 and the last would be n and everything in between is ordered.
So the problem boils down to writing the easiest ordering function of a list that you can, stick it in a for loop to order all lists, then check with a while or for loop the if the List[i] = i+1
I think you can just check the first list and if its correct then you can compare that list to the rest if it is all equal
run it for [[1, 2],[1, 2]] and see what you are missing.
matix = [[1,2,3],[2, 3, 4],[1, 2, 3],[2, 3, 4]]
rows = len(matix)
colums = len(matix[0])
flag = True
for i in range(len(matix)):
row = matix[i]
for val in row:
if val > max(rows, colums):
flag = False
print(flag)
The extra round was such a nice touch! Great competition as was last year and the years before! Good job everybody involved!
I thank God my RUclips algorithm is always delivering to the fullest it knows what I love 😘
The jacopo vs keisuke match was intense, winning on the finals seconds was so exciting
R2 - G1 can be done with a simple comparison im sure:
You have 3 values:
find the largest value
if the sum of the 2 smaller values is less than the larger, return this.
else return the largest value. eg
if(a+b < c) return a+b
else return c
This is gold right here man, I started learning Python some time ago and wow I found this video. I loved it.
currently watching this and its so interesting !!!!.. for the round between bramble and jo , i think i would have first converted the matrix of lists into two matrixes (one for rows , one for cols) and then loop though each one ,to get my answer
Or compute the factorial of "n" and then get the product of all numbers in each row to see if they equal n!
Loved this tournament !! UFC but for coders !! great commentary
I just started programming and learning the basics but am enjoying this for some reason even tho I don't understand what's going on wish me luck in my jouney dear programmers .
all the best mate
U 2 brother@@shurahbeeltariq7459
Need more of these competitions around! Keep it up.
the commentary is so cool, such a juxtaposition to how calm or quiet coding can be 😂
Congratulations! All of you have achieved NERD PRIME!
fun recursion for the 5th task.
def solution(a,b,c):
ls = sorted([a,b,c])
a = ls[-1] - 1
b = ls[1] - 1
c = ls[0]
ls = sorted([a,b,c])
if ls[0] + ls[1] == 0:
return 1
return 1 + solution(a, b, c )
Lol, how no one noticed in the bonus round Layton just wrote simple return 100 discarding the problem statement to use all numbers from 1 to 10
and doesn't use "5".
If this was not a trap in the conditions of the task. For this one test will work just "return 100"
I thought i was on crazy pills.. I had to scroll pretty far down for this comment as well
Obviously the TEST function was rigged. He was lacking so many numbers from his equation.
Also, Layton did not understand the task.
The commentator picking on Layton saying "I don't think he understands the problem yet, I'm sure he doesn't want to write hundreds of numbers!" clearly did not understand it either lol.
Really thanks by watching this im getting confidence that I'm not the only one who struggles/suck at coding
Awesome work! Thanks for putting this together.
I think this is what I needed to take my mind off from other problems. This was awesome.
Jacopo's solution on R1-G3 is wrong if we take two strings having same alphabets, but different in counts. Eg: s1="aaab", s2="abbb". Here, if we use set to store all alphabets of s1, s2; then we get {a,b}. Difference in positions of characters is two, so Jacopo's solution would return True. But in reality, it's False as s1 has three a's, s2 has three b's. So, we need to take a bit-array or hashmap to store characters and their counts for each string separately, then compare the occurrences for each character.
Damn, you're right. Well spotted!
1st condition: return false if strings have not same number of characters
2nd condition: return false if there are more than 1 character mismatch
otherwise just return true
unordered_mapm;
for(int i=0;i
Yes, you are right. Jacopo's solution is not working on certain cases. But, I think, the approach you mentioned that to store characters and their counts for each string separately, then compare the occurrences for each character, will also fail if s1="abba" and s2="abab". If we match the difference in position of characters then it may work. But in my opinion it's better to create a new string from s2 with swapping and compare with s1.
@@sohantirpude2455i am storing index and since the two strings should have been equal means, the index of alpha should be the same, if it isn't we will swap. in leetcode it's called as buddy strings
unordered_mapm;
for(int i=0;i
In the second problem, can't we just use Sn = (n*(n+1))/2 formula? (Sn = sum of first n integers starting from 1)
Basically, what I thought is, just calculate the running sum of each row, then compare it with the Sn, if answer is not equal to Sn then simply return false. Else go forward.
This solution might look good but there might be some bug in this, like what if the row is [6, -6, 6], the row sum is valid, but it does not have all the integers.
Watching bramble get stun locked on that question was brutal. He managed to cobble together something and was frozen solid for a good 10m. It was interesting to see. The sorting was a trap because if it's a matrix you cannot restructure it. Easiest way to do this generate two sets. One of the original array, the other with the appropriate element in each one. And then check length and voila
yes he sorted matrix for row-wise checking,so matrix distorted it is not same coloumn wise checking, My approach to solve that question is first calculate xor of all elements from 1 to n , now create a array for row and one for col and fill them with xor intially , now there is a property of xor - same number xor is always 0,so if ith row contains all numbers from 1 to n then (1 to n) xor (ith row xor) must be 0 , same for col
int xor = 0;
for(int i=0;i
Increible!! yo recién en la universidad he empezado en el mundo de la programación competitiva y siempre uso C++ para las soluciones. Muy interesante lo que han presentado y felicidades a todos los participantes.
You guys absolutely smashed it out the park this year, well done 🎉🎉
wow, this channel and competition is a great finding! Thank you, YT algorithm!
Hurray for Layton !!! I have no idea what was going on but was rooting for him from the start 😅
This deserves a bigger production
Yea, these questions would've taken me an hour to solve...great content!
it's my first time watching something like this and it was actually fun. great job everyone involved
Sum To 100 is not correctly solved and the test should have failed or am I wrong?
The task says "You have the numbers from 1 to 10 in order [...] You may also concatenate digits, however they must remain in the original order [...]".
Layton's line does not include all numbers from 1 to 10 in an order. Example 2 is also wrong, because digit "10" is separated by the symbol * (0 is not included in the given order) and how the heck shall I receive two 5s by inserting symbols?
Thank you, Finally i found someone who notice it !
I now understand people who get rowdy for sports, this was the best thing ive watched in a long time
I love this! And the amount of cringe is just appropriate for the event 😂😂😂😂
Surely one of the best I like the fact that even uni students who are just average can compete in this💯💯.
All the people in there were so cool and vibrant.
Wish to see more of this!
Currently doing my computer science degree loved this you got a new subscriber
This is my first time watching this contest........correct me If I am missing something.....but I think the questions are not that difficult....Can someone please give me a rating of these questions in terms of Codeforces .....it would be really helpful for me to compare.
First couple months coding, learning Python, & this was perfect!! Very cool to witness & motivating as well.
awkward af but was awesome. Love that they did this
1:22:00 (Layton's solution for semifinal round) does it work if a,b,c = 3,3,3? his code returns 3 but we can get 4 (more optimal) if we do as follows:
starting at 333: 322->212->111->001
or am i missing sth? would be great if somebody explained. thank you
edit: my bad i forgot the sorted() on the line l = sorted([i for i in l if i > 0]) in the while loop.
Layton's solution is superb
This is too addictive to watch,
Well.. for the question about ROCKS and PILES..i have a different kinda solution..that could give the correct answer..and it goes like this:
make a list list1 of sorted a, b,and c.
and another list list2 of sorted (a,b,c-a).
Then find the min of list1 and list2 & add both of them
That should give you the no. of moves required !!
Anyways..Thanks for such great videos!!
a = 1 , b = 5, c = 7
list 1 = 1 5 7
list 2 = 1 5 6
min of list 1 = 1
min of list 2 = 1
Your answer would be 1 + 1 = 2 which is incorrect
If sorted piles are a, b, c. Then isn't max score just b+min(a, c-b)?
Best idea i've seen in ages, you guys found a hit with this one
R1 - G3: my solution
count = 0
n = len(str1)
for i in range(n):
if str1[i] != str2[i]:
count += 1
if count > 2:
return False
return count != 1
R1 - G4: my solution
sq = []
for l in rectangles:
sq.append(Min(l[0], l[1])
return len[x for x in sq if x == sq.max()]
R2-G1: my solution
s = sorted[a,b,c]
count = 0
while s[0] != 0 and s[1] != 0:
if s[0] != 0:
s[0] -= 1
else:
s[1]-= 1
s[2] -= 1
count += 1
s = sorted[s]
return count
Looks interesting. Are the questions available on any coding platforms for us to try it ourselves?
If you google the questions you will find the problems on leetcode
I never would have thought ranked LeetCode would be an ESports category. WE NEED MORE OF THIS!
I don't understand how "return 1 + 2 + 3 + 4 + 9 * 10" was accepted as a solution.
According to my understanding and the examples provided, all numbers from 1 to 10 must be included in the solution.
If "return 1 + 2 + 3 + 4 + 9 * 10" worked, then a simple "return 2 * 5 * 10" should have worked too, right?
I assume "return 100" would have solved the problem as well...
Or was it accepted because of the poor wording, since it doesn't say "you must use each digit exactly once"?
yes
This is awesome! Question, for Jacopo and Kei's challenge, could you not just multiply the ASCII character values from each string together and then check if the product of both strings are equal? That would mean that they both have the same characters in them, which would need to be the case in order to do a character swap.
I loved it. Thank you so much for posting.
loved watching this. It's educational and entertaining. please continue on, on your awesome show
Only few things I think would improve this, Move that TV behind you guys a little higher so the informations are not blocked by your shoulder. Also when either coder won, run through their code real quick. And lastly maybe position the coders a little better so the introducer is not awkwardly standing and blocking them after introducing them (it's just a tiny change that would improve it in my opinion)
Everything else is perfect
can't wait for the next videos
wow this is wonderful, love it thanks for sharing fam!!!
The presenting is exactly what I was expecting. I'm here for all of this.
Reallly, such easy questions!!
agreed, took me 2 minutes to think and code each one. Sad to see how people with multiple years of experience are pretty bad at problem solving.
This is awesome!!!! I am so happy to stumble upon this!!
this was great to watch, keep it up!
36:53
function swap(a,b){
array1=a.split('');
array2=b.split('');
return array1.join('')===array2.reverse().join('');
}
We got coders cup b3fore gta 6 💀
This is dope stuff. As someone’s just getting into programming, this is motivating me to get better
These are my people!
your creative teams make great inspiring fire and motivation to us who like create logic shapes. you can grow to meet big effect to code and logic creators. try continue be fire and inspiring . i subscribed
Hoping someday I will become great programmer
blessed by this beautiful recommendation , we need more competition
Really good can’t we have one every week
Very very exciting as well as interesting 👏🏻👏🏻👏🏻both teams are pro max level coders ❤.
Are the anchors comedians lol. Great work anchors
Great work all. Have fun. I appreciate if you share challanges/test cases under this video for us to try. Cheers...
You can feel the social awkwardness in this video. I feel at home.
This event has been an inspiration for me. I will do something similar in Indonesia.
Thank you very much for the inspiration.
Why are these questions so basic?
A clever person looks for complexity, a genius looks for simplicity
@@Pepespizzeria1 Blessed
@@Pepespizzeria1 reply nonsense! The questions are basic for real...
The rounds would probably be too long
Then join the competition next time!
for third question, just having same characters in both the strings is enough as when we have same characters, no matter in what way they are ordered, we can always arrange them correctly by successively swapping unordered characters
It was really great watching this.
That was way more enjoyable than I ever imagined thank you for creating such a great event