 Alright guys, so I didn't want to do this question So I'll just copy and paste the solution and tell you guys How to do it because I don't know how they found this solution though, but that is how it works though It just somehow works. Alright, so this the question is projection area of 3d shapes You're given a grid and you want to place 1 by 1 by 1 cubes that are aligned with the x and y and z axis. Each value represents the tower of cubes v placed on top of the grid cell i and j When we view the projections onto the x, y, z, y, z and z, x planes The projection is a shadow that maps the 3d figure to a two-dimensional plane When you view the shadow you're looking at the cubes from the top the front and the side Return the total number of area of three projections so essentially here is that Based on this cube there's in this picture you're you want to return the area from the side The front so this way the side and the top so based on the top we know from the top it's four four Four cubes right it's four four squares based on the top from this side We know there's two two of these one of these and then a big long of these So that's this side because they have You know this part in it and then the final side is this side, which is this way is Looks like that. So I didn't want to come up with this solution So I'm just gonna copy and paste this Basically from the top the shadow The shadow makes a one square for each non-zero value from the side There's it's the largest value for each row from the other side is to the largest value for each column So the only way you could have figured this out is actually count like Come up with a multiple cases of squares and then count them up yourself This isn't really an algorithm problem. This is just finding the pattern recognition So you probably I don't think this would ever show up on it in an actual interview, but just in case I'll type this up with you guys. Okay, so we're gonna get the length n Based on the size and we're gonna have an answer starting from zero then we're gonna go from zero to n and Pre-increment I After that what we're gonna do is we're gonna find the best row because that's apparently the y value best column of Which is apparently the best z value and we're gonna go through every single column in our Every single column inside our array So now once we do that we're gonna check we're gonna get the make sure the top value is The top shadow if it's greater than zero then that means it's It's the top shadow, which is something that they figured it out, but I don't have I don't want to do Draw multiple cases of squares then the sides apparently it's just the maximum best row Based on each grid and based on each row value column That's what the sides are best column is equal to math dot max and this is best column grid J There were there swapping the act they're not swapping They're just going to the best possible column and then after that they add answer to e plus equal best row Plus best column and then they return the answer. So that's basically how you would do it. I don't want to Figure this out myself because this just doesn't I don't see the purpose of this There's no data structure. There's no not really any sense of this, but that's basically how you would do it Why am I getting a compiler? Oh, I can't do it's not math on max and c++. It's just max Okay, so that's what you that would fix that. Let's submit the question and It got accepted. So this is a dumb question I hope none of this actually occurs in actual interview, but ray coms subscribe. I hope I hope this made sense to you guys You would in order to actually figure this out. You would have to draw multiple multiple squares and Just try to figure it out mathematically because there's no way you could actually do this Just there's no complicated structure in this problem. So yeah, you want to figure this out mathematically just just have multiple cases of cubes and Just try to do find the the area from the top of the left and the right and you'll probably get the same answer But yeah, that's all you have to do it ray coms subscribe. Check you guys later. Peace