Jul 14, 2024
You should try to write such a code and ensure it is optimized for space , computational speed and practical compared to simple the simpler representations. I think you are assuming shapes are only 2D and not in higher dimensions and dont have more properties than just the area.
Again, the above example is about generics not specifically for geometrical shapes.