<p>Given a 2D <code>grid</code> of <code>0</code>s and <code>1</code>s, return the number of elements in the largest <strong>square</strong> subgrid that has all <code>1</code>s on its <strong>border</strong>, or <code>0</code> if such a subgrid doesn't exist in the <code>grid</code>.</p>