Distinct Payment Methods

Easy
Deduplication

Distinct Payment Methods

The payments table contains repeated payment methods.

Return each distinct method once, sorted alphabetically.

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.payments6 rows
payment_id (int)method (string)
1card
2upi
3card
4netbanking
5upi
6wallet

Return these columns

method(string)

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.