US22 - Implement function to validate grid from input

Functions to validate grid from input, this functions will be moved
where they fit better.