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
function solve(str) { var maxStr = '', tmpStr = ''; var hashed = {}; for (const c of str) { if (!hashed[c]) { hashed[c] = true; tmpStr += c; } else { if (tmpStr.length > maxStr.length) { maxStr = tmpStr; tmpStr = c; } } } return maxStr; }
The text was updated successfully, but these errors were encountered:
@consoles 感谢指明! 每道题都应该会有其最优的解法,因为毕竟很多题我只写出了自己第一时间想到的方法。。而且随着题目序数的增大,我的题解应该会有所进步吧,毕竟自己是按照顺序从第一题开始刷的。。🌚
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: