Skip to content

Instantly share code, notes, and snippets.

@josephrexme
Last active March 16, 2018 12:38
Show Gist options
  • Save josephrexme/68526f00ad007ec678429972a0523242 to your computer and use it in GitHub Desktop.
Save josephrexme/68526f00ad007ec678429972a0523242 to your computer and use it in GitHub Desktop.
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