Created
May 6, 2015 08:14
-
-
Save othree/17e9fb5614c0e3a4eb2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var removeElements = function(head, val) { | |
if (head === null) { return null; } | |
if (head.val === val) { | |
return removeElements(head.next, val); | |
} else { | |
head.next = removeElements(head.next, val); | |
} | |
return head; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment