#187 | Find maximum volume of a cuboid | gfg potd | 19-06-2024 | GFG Problem of The Day

preview_player
Показать описание
🚀 Solving Geeks for Geeks Problem of the Day(POTD) in C++ | Find maximum volume of a cuboid | Intuition Explained🧠

----------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------

🌐 Connect with Me:

💬 Have questions or suggestions? Drop them in the comments below! Let's learn and grow together. Happy coding! 👨‍💻

#GFG #POTD #geeksforgeeks #problemoftheday #c++
Рекомендации по теме
Комментарии
Автор

bro formula for volume u calculated in here is different from which u implemented in the code, in the code u implemented volume=l^2 *(p/4)-(2*l);
which i could n't find in here 5:40

MilanNakum-gc
Автор

why are you caculating twice
perimeter - (sqrt(pow(perimeter, 2) - (24 * area)))) / 12,

Please try to upload cleaner code

aizadiqbal
Автор

Here is my code which is easy to Understand:
double l = (p - sqrt((p * p) - (24 * a))) / 12;
double ans = (l * l) * ((p / 4) - (2 * l));
return ans;

Shiva_XD_
Автор

also tried to code based on given volume formula but it was failing for big test case

your code logic seems different ...

aizadiqbal
Автор

Bro pls help it is getting stuck at 1110 test case I dont know whats the problem...

// User function Template for Java

class Solution {

double maxVolume(double perimeter, double area) {
// code here
double
double
return v;
}
}

siddharthbhagat
Автор

ans at 110 coming 1131004.73 but my output comes out to be 1131004.67

entreprenuermind