add solution for stock i problem