Skip to content

Instantly share code, notes, and snippets.

// https://leetcode.com/problems/validate-binary-search-tree/
// Javascript version for Validate BST Tree using iteration
var isValidBST = function(root) {
 if (!root) return true; 
 
 const stack = [];
 let prevNode = null;
 
 while(root != null || stack.length > 0) {
while(root != null) {
(function() {
console.log('love js');
})();