Within each category, find pairs of products whose prices differ by less than 500. Return category, product_a, product_b (each pair once) and gap (absolute difference).
2 rows with columns category, product_a, product_b, gap
Run your code to see the output here.