ShareChat interview question

Rain trapping water problem and solution