File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 226
226
| 2331| [ 计算布尔二叉树的值] ( https://leetcode.cn/problems/evaluate-boolean-binary-tree/ ) | [ JavaScript] ( ./algorithms/evaluate-boolean-binary-tree.js ) | Easy|
227
227
| 2335| [ 装满杯子需要的最短总时长] ( https://leetcode.cn/problems/minimum-amount-of-time-to-fill-cups/ ) | [ JavaScript] ( ./algorithms/minimum-amount-of-time-to-fill-cups.js ) | Easy|
228
228
| 2351| [ 第一个出现两次的字母] ( https://leetcode.cn/problems/first-letter-to-appear-twice/ ) | [ JavaScript] ( ./algorithms/first-letter-to-appear-twice.js ) | Easy|
229
+ | 6354| [ 找出数组的串联值] ( https://leetcode.cn/problems/find-the-array-concatenation-value/ ) | [ JavaScript] ( ./algorithms/find-the-array-concatenation-value.js ) | Easy|
229
230
| 面试题 04.12| [ 面试题 04.12. 求和路径] ( https://leetcode.cn/problems/paths-with-sum-lcci/ ) | [ JavaScript] ( ./algorithms/paths-with-sum-lcci.js ) | Medium|
230
231
| 面试题 02.07| [ 面试题 02.07. 链表相交] ( https://leetcode.cn/problems/intersection-of-two-linked-lists-lcci/ ) | [ JavaScript] ( ./algorithms/intersection-of-two-linked-lists-lcci.js ) | Easy|
231
232
| 剑指 Offer 05. 替换空格| [ 剑指 Offer 05. 替换空格] ( https://leetcode.cn/problems/ti-huan-kong-ge-lcof/ ) | [ JavaScript] ( ./algorithms/ti-huan-kong-ge-lcof.js ) | Easy|
Original file line number Diff line number Diff line change
1
+ /**
2
+ * 6354. 找出数组的串联值
3
+ * @param {number[] } nums
4
+ * @return {number }
5
+ */
6
+ var findTheArrayConcVal = function ( nums ) {
7
+ let result = 0 ;
8
+ let left = 0 ;
9
+ let right = nums . length - 1 ;
10
+
11
+ while ( left < right ) {
12
+ const curr = `${ nums [ left ] } ${ nums [ right ] } ` ;
13
+ result += Number ( curr ) ;
14
+ left ++ ;
15
+ right -- ;
16
+ }
17
+ if ( nums . length % 2 !== 0 ) {
18
+ result += nums [ left ] ;
19
+ }
20
+ return result ;
21
+ } ;
You can’t perform that action at this time.
0 commit comments