{"action":"opened","issue":{"url":"https://api.github.com/repos/Shawngbk/Leecode/issues/148","repository_url":"https://api.github.com/repos/Shawngbk/Leecode","labels_url":"https://api.github.com/repos/Shawngbk/Leecode/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/Shawngbk/Leecode/issues/148/comments","events_url":"https://api.github.com/repos/Shawngbk/Leecode/issues/148/events","html_url":"https://github.com/Shawngbk/Leecode/issues/148","id":189251234,"number":148,"title":"422. Valid Word Square","user":{"login":"Shawngbk","id":18609174,"avatar_url":"https://avatars.githubusercontent.com/u/18609174?v=3","gravatar_id":"","url":"https://api.github.com/users/Shawngbk","html_url":"https://github.com/Shawngbk","followers_url":"https://api.github.com/users/Shawngbk/followers","following_url":"https://api.github.com/users/Shawngbk/following{/other_user}","gists_url":"https://api.github.com/users/Shawngbk/gists{/gist_id}","starred_url":"https://api.github.com/users/Shawngbk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shawngbk/subscriptions","organizations_url":"https://api.github.com/users/Shawngbk/orgs","repos_url":"https://api.github.com/users/Shawngbk/repos","events_url":"https://api.github.com/users/Shawngbk/events{/privacy}","received_events_url":"https://api.github.com/users/Shawngbk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-14T23:01:00Z","updated_at":"2016-11-14T23:01:00Z","closed_at":null,"body":"(i,j) (j,i)这两个坐标的字符必须相同，而且所在的行列长度相同\r\npublic class Solution {\r\n    public boolean validWordSquare(List<String> words) {\r\n        int row = words.size();\r\n        if(row == 0)\r\n        return true;\r\n        int col = words.get(0).length();\r\n        if(row != col)\r\n        return false;\r\n        for(int i = 0; i < row; i++) {\r\n            if(row < words.get(i).length())\r\n            return false;\r\n            for(int j = 0; j < words.get(i).length(); j++) {\r\n                if(row <= j || words.get(j).length() <= i \r\n                || words.get(j).charAt(i) != words.get(i).charAt(j))\r\n                return false;\r\n            }\r\n        }\r\n        return true;\r\n    }\r\n}"}}
{"actor":{"display_login":"Shawngbk"}}