Solution for Bank problem