Skip to content

Commit

Permalink
Allow more array types
Browse files Browse the repository at this point in the history
  • Loading branch information
Otanga-Otieno committed Apr 7, 2022
1 parent 20cc22a commit 568c740
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index/src/pages/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ async function heapify(arr, n, i) {

}

/************************************* End of algorithms**********************/
/************************************* Helper functions**********************/

function originalArray(arr) {

Expand Down Expand Up @@ -456,8 +456,8 @@ function clearChildren(id) {
function getArray(sortFunction) {

let input = document.getElementById("userarray").value;
input = input.replace("[","");
input = input.replace("]","");
input = input.replace("[","").replace("{","").replace("(","").replace("<","");
input = input.replace("]","").replace("}","").replace(")","").replace(">","");
let arr = input.substring(0, input.length).split(",");
arr = arr.map(Number);
if(arr.length < 2) return;
Expand Down

0 comments on commit 568c740

Please sign in to comment.