虽然是Easy的题,自己却想不出来,最后只好参考了这个 Given a string, find its first non-repeating character 的思路,倒也很容易看明白,一点就破的题。
Java
1 | class Solution { |
Submission Detail
- 104 / 104 test cases passed.
- Runtime: 61 ms
- Your runtime beats 25.39 % of java submissions.
JavaScript
1 | /** |
Submission Detail
- 104 / 104 test cases passed.
- Runtime: 108 ms
- Your runtime beats 37.23 % of javascript submissions.