You are viewing a single comment's thread. Return to all comments →
It is because you need to ensure that rows*cols >= Lemgth of string.
We need to keep rows <= cols so we keep rows as the floor of squareroot and cols as the ceiling.
now if rows*cols < L then you need to add another row to make things fit.
Encryption
You are viewing a single comment's thread. Return to all comments →
It is because you need to ensure that rows*cols >= Lemgth of string.
We need to keep rows <= cols so we keep rows as the floor of squareroot and cols as the ceiling.
now if rows*cols < L then you need to add another row to make things fit.