Insurance Premium with GST

Easy
Arithmetic
Insurance
Acko

Insurance Premium with GST

An insurance-style billing team adds GST to base premiums.

Return policy_id, total_premium, where total premium is base_premium * (1 + gst_pct / 100), rounded to 2 decimal places. Sort by policy_id ascending.

Browser Engine: Evaluates PySpark DataFrame & SQL logic locally in Pyodide WebAssembly.

Input data

1 DataFrame

These DataFrames are passed to solve(spark, dfs). Access one with dfs['name'].

df.policies6 rows
policy_id (int)customer_name (string)base_premium (double)gst_pct (double)
1Aarav1200018
2Bela850018
3Chen2400018
4Dia50005
5Eli1500018
6Fay300005

Return these columns

policy_id(bigint)
total_premium(double)

Column names and order must match. Sort order is specified in the question.

Browser engine
Loading Python editor…
Click Run to try the sample cases, or Submit to check the hidden cases. First run caches the browser Python engine (~8–15s once); all code stays on your device.