We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果碰到多维数据就废了,比如: let arr = [1, 2, [3, 4, [5, 6, 7, 3, [10, 12]], 7, 8]]; 当然你这个解题对二维数组是完全可以解决的,但我觉得应该尽量想的周全一点。 加油。
let arr = [ [1, 4, 6], [7, 8, 10], [2, 6, 9], [3, 7, 13], [1, 5, 12] ]; //[[1,2,3],[4,5,6],[7,8,9],[1,2,3],[4,5,6]] function func(arr) { return Array.from(new Set(arr.flat(1))).sort((a, b) => a - b) } //[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13] // [1, 2, 3, 4, 5, 6, 7, 8, 9]
Originally posted by @azhen98 in #8 (comment)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如果碰到多维数据就废了,比如:
let arr = [1, 2, [3, 4, [5, 6, 7, 3, [10, 12]], 7, 8]];
当然你这个解题对二维数组是完全可以解决的,但我觉得应该尽量想的周全一点。
加油。
没有添加任何判断只是为了实现需求 不知道自己写的对不对 看上面大家都写了好多 是不是我理解错了啊
Originally posted by @azhen98 in #8 (comment)
The text was updated successfully, but these errors were encountered: