Create a Pivot Table

Asked at Sigma Computing · Coding Questions · Difficulty: Medium · Last asked Jul 15, 2026

Given three column names, compute aggregate values to create a pivot table. Use one column name for aggregation by summing, and use the remaining two column names as X and Y axes. Write a function to display the table. Additionally, require a row/column to be added that displays the total for each row/column. Finally, extend the functionality to use three column names as XY axes without needing to display the total.

Loading the problem…