This commit is contained in:
Electrominch
2022-10-12 02:30:23 +03:00
parent 02afed9c4c
commit 01c5720116
39 changed files with 517 additions and 30 deletions

View File

@@ -6,11 +6,11 @@ public class Solution
{
int min = Math.Min(p.val, q.val);
int max = Math.Max(p.val, q.val);
while(true)
while (true)
{
if (root == null)
return null;
else if (min <= root.val && max>=root.val)
else if (min <= root.val && max >= root.val)
return root;
else if (root.val >= p.val)
root = root.left!;