彩神大发快三_神彩大发快三官方

[LeetCode] Ransom Note

时间:2019-12-23 18:22:05 出处:彩神大发快三_神彩大发快三官方

This code takes about 300ms.

A very typical application of hash maps. Since I am now learning Java, I code in Java. The following code uses toCharArray() and getOrDefault(), which are learnt from this post.

This version is much faster, about 13ms.

In fact, arrays can be used to replace hash maps since the test cases of this problem only contan the 26 English letters. A array-version solution can be found here and is rewritten below.

热门

热门标签