From the City of Himeji.
In 1580, for Hashiba (Toyotomi) Hideyoshi’s campaign in western Japan, Kuroda Yoshitaka gave the castle to Hideyoshi, who built a three-story keep.
After the Battle of Sekigahara in 1600, Ikeda Terumasa became the lord of the castle. In 1601 he began to rebuild it, and in 1609 the connected main keep was finished.
Many families ruled the castle after that. The Sakai family ruled it from 1749 until the Meiji Restoration.
In 1869 the lord returned his lands to the Emperor, and the castle became the property of the nation.
From 1956 to 1964, the keeps were taken apart and repaired at national expense (the Great Showa Repair).
In December 1993, Himeji Castle and Horyu-ji in Nara became Japan’s first World Cultural Heritage sites.
Himeji Castle is seen as a building that represents Japanese castle architecture of the early 17th century.
There is no single right answer. Talking it over with someone at home is a good way to learn.