![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode javascript 答案+解析
文章平均质量分 77
M_ye
这个作者很懒,什么都没留下…
展开
-
LeetCode 806.Number of Lines To Write String JavaScript 答案+解析
先放答案:var numberOfLines = function(widths, S) { var sum = 0 , con = 1; for(var i = 0 ; i < S.length ; i++){ var t = widths[S[i].charCodeAt(0) - 97]; if(sum + t > 100 ) co...原创 2018-10-21 19:27:47 · 163 阅读 · 0 评论 -
LeetCode 111.Minimum Depth of Binary Tree/ c++ & java & JavaScript
问题描述:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.找二叉树的最小深度java版本答案:/** * Defin...原创 2019-07-02 21:58:29 · 150 阅读 · 0 评论 -
LeetCode 150. evaluate-reverse-polish-notation / java
问题描述:Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another expression.Some examples: ["2", "1", "+", "...原创 2019-07-02 22:58:47 · 189 阅读 · 0 评论