Skip to content

Instantly share code, notes, and snippets.

@josephrexme josephrexme/trumpsort.js
Last active Mar 16, 2018

Embed
What would you like to do?
const TrumpSort = (arr) => {
let pushArray = [0];
let wallHeight = pushArray[pushArray.length - 1];
arr.forEach((v, i) => {
if(v > wallHeight) pushArray.push(v);
});
pushArray.shift();
return pushArray;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.