Given a List of words, return the words that can be typed using letters of alphabet on only one row’s of American keyboard like the image below.
Example 1:
Note:
You may use one character in the keyboard more than once.
You may assume the input string will only contain letters of alphabet.
解法1:
这题就是掌握一下语言中对于string查找相关的操作。
Java
Java中的string.toCharArray(),还有查找一个char是否在string里的操作string.indexOf(s) == -1