create a function that checks the values of the indexes in two arrays and keep a score
const triplets = (arr1,arr2) => {
let score1 = 0;
let score2 = 0;
let resultArr = [0,0]
for (let i = 0; i < arr1.length; i++){
if(arr1[i] === arr2[i]) {
resultArr[0] = score1
resultArr[1] = score2
} else if (arr1[i] > arr2[i]) {
score1++
resultArr[0] = score1
} else if (arr1[i] < arr2[i]) {
score2++
resultArr[1] = score2
}
}
return resultArr
}
Also in PHP:
- drop down php form retrieve data from database
- check if table exists sql php
- artisan clear commands
- clear the cache in laravel
- douzo definition
- Allowed memory size of 1610612736 bytes exhausted laragon
- : Allowed memory size of 268435456 bytes exhausted (tried to allocate 77155656 bytes) in /home/gergstor/public_html/seo/application/third_party/MX/Loader.php on line 373 A PHP Error was encountered Severity: Error Message: Allowed memory size of
- factoring and seeding in laravel
- What does PEAR stands for?
- console.log on php
- Composer detected issues in your platform
- date("U")
- apagar cache laravel
- php + server + databse
- alert laravel 7
- check if a char is in a string php
- delete uploaded file php
- clear cache swr
- catch new exception php
- cannot use object of type stdclass as array
- artisan cache command in laravel
- check substring in string php
- The key "initial" is not recognized and ignored.
- blade format date