CODING 3MIN: REMOVE SCREWS I

Subscribers:
4,890
Published on ● Video Link: https://www.youtube.com/watch?v=9R0ZBqbCRQI



Duration: 3:31
20 views
2


My task is to return the total time taken to remove all the screws, in seconds

EXPLANATION CODE:
1) The function sc calculates the sum based on the screws array. It initializes the sum variable to 1. Then, it iterates through the screws array starting from the second element. For each iteration, it compares the current screw with the previous screw. If they are equal, it adds 2 to the sum; otherwise, it adds 7. Finally, it returns the calculated sum.

Contents:
0:00 - Reading
1:40 - Solving
3:01 - Explaining

#codewars #code #wars #javascript #game #remove #screws #programming #education #tutorial #computerscience #mathematics #games #puzzles







Tags:
codewars
code
wars
tutorial
step by step
education
computer science
explanation
7kyu
algorithms
games
puzzles
javascript
javascript programming
coding 3min: remove screws
coding
3min
remove
screws