Revolut Interview Question

solve data problem using SQL