-
Notifications
You must be signed in to change notification settings - Fork 150
BJ001-1904150 Week2 homework #305
New issue
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
base: master
Are you sure you want to change the base?
Conversation
prefix = plist[0]; | ||
for i in range(1, len(plist)): | ||
route = prefix + "/" + plist[i].split("(")[0] | ||
content = plist[i].split("(")[1].split(")")[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你这方案倒是不错,能加点注释说明思路吗?
if(root == NULL && root->left == NULL) | ||
return -1; | ||
long long ans = findmin(root, root->val); | ||
return ans == 2147483648 ? -1 : ans; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2147483648 是什么魔法数字?同学加点注释说说你的思路吧
|
||
while(ans.size() != k) { | ||
P tmp = que.top(); | ||
ans.push_back(tmp.first); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你这没法保证频次相同的按字母顺序排呀
学号用150就可以了哈,不需要前面的一长串。 代码文件命名规则:LeetCode_题目序号_学号,比如学号为 0 的学员完成 LeetCode 的第 2 题 后,请将代码文件名保存为 LeetCode_2_0.py (假设你使用的是 Python 语言)。 |
No description provided.