← Microsoft questions
CodingReported in a candidate post, Jul 2019

Total Ships in Power Layers

Filed under Microsoft

Calculate the total number of ships across N layers modulo M. Each ship of power V in layer i generates ships with powers 0 to (V*(V+1)%M - 1) in the next layer.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Microsoft questions

Collected from public candidate posts and coding forums. Updated Nov 2026.