Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
1 |
class { |
思路:
1.我们这边需要保证连续的数字无论是哪一个,map取值都是连续的个数。
2.遇到相同的数字不予处理。
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.
1 |
class { |
思路:
1.我们这边需要保证连续的数字无论是哪一个,map取值都是连续的个数。
2.遇到相同的数字不予处理。
近期评论