Skip to content

Commit

Permalink
reto-3-1
Browse files Browse the repository at this point in the history
  • Loading branch information
fernargdev committed Dec 13, 2023
1 parent 082c1f1 commit ae35c62
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion retos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<body style="background-color: rgb(24, 21, 21);">

<!-- <script src="reto-1.js"></script> -->
<script src="reto-2.js"></script>
<!-- <script src="reto-2.js"></script> -->
<script src="reto-3.js"></script>
</body>

</html>
16 changes: 16 additions & 0 deletions retos/reto-3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable no-unused-vars */
/* eslint-disable space-before-function-paren */
function findNaughtyStep(original: [], modified: []) {
if (original.length === modified.length) return ''

const max = modified.length > original.length ? modified : original

for (let i = 0; i < max.length; i++) {
if (original[i] !== modified[i]) return max[i]
}
}

const original = 'abcd'
const modified = 'abcde'

// console.log(findNaughtyStrp(original, modified))

0 comments on commit ae35c62

Please sign in to comment.