422. Valid Word Square

Problem

Return true if a given sequence of words forms a valid word square (the k-th row and column are identical).

Given a list of words, determine if they form a valid word square. A valid word square means that the kth word (0-indexed) has the same sequence of characters as the kth column for all valid k.

Examples
Input: ["abcd","bnrt","crmy","dtye"]
Output: true
Hints
Related Problems

422. Valid Word Square

Return true if a given sequence of words forms a valid word square (the k-th row and column are identical).