 | | codevn V2EX 第 89262 号会员,加入于 2014-12-31 10:20:35 +08:00 |
 | 根据 codevn 的设置,主题列表被隐藏 |
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
codevn 最近回复了
```
class TreeNode {
constructor(value = 0, children = []) {
this.value = value;
this.children = children;
}
}
function trimTree(root, target) {
if (!root) return null;
let queue = [root];
let result = new TreeNode(root.value);
let resultQueue = [result];
let currentSum = root.value;
while (queue.length > 0) {
let currentNode = queue.shift();
let resultNode = resultQueue.shift();
let childrenSum = 0;
let tempChildren = [];
for (let child of currentNode.children) {
queue.push(child);
childrenSum += child.value;
let newChild = new TreeNode(child.value);
tempChildren.push(newChild);
resultQueue.push(newChild);
}
if (currentSum + childrenSum <= target) {
resultNode.children = tempChildren;
currentSum += childrenSum;
} else {
let remaining = target - currentSum;
resultNode.children = [];
for (let child of tempChildren) {
if (child.value <= remaining) {
resultNode.children.push(child);
remaining -= child.value;
} else {
child.value = remaining;
resultNode.children.push(child);
break;
}
}
break;
}
}
return result;
}
// 示例
let child1 = new TreeNode(80);
let child2 = new TreeNode(80);
let root = new TreeNode(100, [child1, child2]);
let trimmedTree = trimTree(root, 200);
console.log(trimmedTree);
```
这意思么?
人家是规则制定者? 你准备制裁他? 法律不管这个事的~
你可以学着适应,或者适应,也可以适应~
但凡你有能力改变这件事,应该也没这个帖子了吧
涨幅 20% => 别跑
涨幅 20K => 马上跑
一向不都是 p6~p8 么,这次降级到 p5 了?
其实也不能怪大厂卡学历;
学历这东西是一个可查询并且公允的成果; 也算是一个别人可见的 "最高成就";
大厂往往是想通过你的"最高成就"来评定以及预估你的的水平以及未来的成就;
你可以尝试其他方式取得"最高成就", 比如在某些技术社区产生影响力 / git 拿到几 k 的 star/某些技术峰会发表过演讲等等~
否则真的很难拿到大厂的 offer;
亲身体会告诉你: 辍学的那一天到你现在的时间足够取得一定成就了,如果还没有取得一定成就,你可能真的要反思一下自己问题在哪里了.
补充一点,你如果有 >=p8 的水准那么请无视学历这件事~
大厂基本都卡学历,阿里相对好一些; 举个例子
如果你学历不行,你需要绕过 HR 去找招人部门内推,然后你的水平至少是你面的级别+1,比如你要拿 p6 岗位,你至少要有 P6+甚至 P7 水准,这个时候你才大概率能拿到 offer ;
然后在内部好好奋斗,基本一年左右就能升职到真正符合自身水准的级别了;