chore: add comments and format code

This commit is contained in:
LuanRT
2021-10-25 18:02:28 -03:00
parent 389b0f362f
commit b2117f11b9
6 changed files with 33 additions and 41 deletions

View File

@@ -20,10 +20,10 @@ class SigDecipher {
arr.splice(0, end);
}
function swap(arr, position) {
function swap(arr, index) {
let origArrI = arr[0];
arr[0] = arr[position % arr.length];
arr[position % arr.length] = origArrI;
arr[0] = arr[index % arr.length];
arr[index % arr.length] = origArrI;
}
function reverse(arr) {