We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a5f475 commit 0fb5f05Copy full SHA for 0fb5f05
algorithms/jcc-addTwoNumbers/addTwoNumbers.js
@@ -0,0 +1,13 @@
1
+/**
2
+ * @param {ListNode} l1
3
+ * @param {ListNode} l2
4
+ * @return {ListNode}
5
+ */
6
+ var addTwoNumbers = function(l1, l2) {
7
+ const l1Num = Number(l1.reverse().join(''));
8
+ const l2Num = Number(l2.reverse().join(''));
9
+
10
+ const sum = l1Num + l2Num;
11
12
+ return sum.toString().split('').map(item => Number(item));
13
+};
algorithms/jcc-addTwoNumbers/index.html
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Document</title>
+</head>
+<body>
+</body>
+<script src="./addTwoNumbers.js"></script>
+</html>
0 commit comments