Exercises/#40 Kth Smallest in BST
#40

Kth Smallest in BST

Medium🌳 Trees
80 XP

Problem

Given the root of a BST and an integer k, return the kth smallest value (1-indexed).

Examples

Input: root=[3,1,4,null,2], k=1
Output: 1

Input: root=[5,3,6,2,4,null,null,1], k=3
Output: 3
treebstdfsin-order
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

40 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features