From a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Fri, 27 Jun 2025 12:23:02 -0600 Subject: chore: remove old cpp and rust solutions --- other/unique_bst2.cpp | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 other/unique_bst2.cpp (limited to 'other/unique_bst2.cpp') diff --git a/other/unique_bst2.cpp b/other/unique_bst2.cpp deleted file mode 100644 index 438d9b7..0000000 --- a/other/unique_bst2.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// 95. Unique Binary Search Trees II -#include "leetcode.h" - -/* - * given an integer 'n', return all the structurally unique BST's which has - * exactly 'n' nodes of unique values from 1 to 'n'. return the answer in any - * order. - */ - -class Solution { - vector build(int from, int to) { - vector res; - if (to - from < 0) - res.push_back(0); - if (to - from == 0) - res.push_back(new TreeNode(from)); - if (to - from > 0) - for (int i = 0; i <= to; i++) { - vector left = build(from, i - 1); - vector right = build(i + 1, to); - for (int j = 0; j < left.size(); j++) - for (int k = 0; k < right.size(); k++) { - TreeNode *height = new TreeNode(i); - height->left = left[j]; - height->right = right[k]; - res.push_back(height); - } - } - return res; - } - -public: - vector generateTrees(int n) { return build(1, n); } -}; -- cgit v1.2.3