ION Group Interview Question

Japenese ship puzzle on gfg