Total number of apples =1+2+3+4+⋯+n=2n(n+1)​ Now, 2n+(n+1)​≤150⇒n(n+1)≤350lf n = 16, then n(n+1)=16×17=272≤350If n = 16, then n (n +1) = 17 × 18 = 306 > 350Hence, in the fruit shop, apples are initially in 16 rows.Total number of apples initially =216×17​=136Now, 136−126=10And 1+2+3+4=10Hence, apples in the top 4 rows had sold, when 126 apples remained in the shop.∴ Total number of rows having 126 apples left =16−4=12