Input{"root":[50000,25000,75000,12500,37500,62500,87500,6250,18750,31250,43750,56250,68750,81250,93750,3125,9375,15625,21875,28125,34375,40625,46875,53125,59375,65625,71875,78125,84375,90625,96875,1,50001,75001,12501,37501,62501,87501,6251,18751,31251,43751,56251,68751,81251,93751,3126,9376,15626,21876,28126,34376,40626,46876,53126,59376,65626,71876,78126,84376,90626,96876,2,50002,75002,12502,37502,62502,87502,6252,18752,31252,43752,56252,68752,81252,93752,3127,9377,15627,21877,28127,34377,40627,46877,53127,59377,65627,71877,78127,84377,90627,96877,3,50003,75003,12503,37503,62503,87503,6253,18753,31253,43753,56253,68753,81253,93753,3128,9378,15628,21878,28128,34378,40628,46878,53128,59378,65628,71878,78128,84378,90628,96878,4,50004,75004,12504,37504,62504,87504,6254,18754,31254,43754,56254,68754,81254,93754,3129,9379,15629,21879,28129,34379,40629,46879,53129,59379,65629,71879,78129,84379,90629,96879,5,50005,75005,12505,37505,62505,87505,6255,18755,31255,43755,56255,68755,81255,93755,3130,9380,15630,21880,28130,34380,40630,46880,53130,59380,65630,71880,78130,84380,90630,96880,6,50006,75006,12506,37506,62506,87506,6256,18756,31256,43756,56256,68756,81256,93756,3131,9381,15631,21881,28131,34381,40631,46881,53131,59381,65631,71881,78131,84381,90631,96881,7,50007,75007,12507,37507,62507,87507,6257,18757,31257,43757,56257,68757,81257,93757,3132,9382,15632,21882,28132,34382,40632,46882,53132,59382,65632,71882,78132,84382,90632,96882,8,50008,75008,12508,37508,62508,87508,6258,18758,31258,43758,56258,68758,81258,93758,3133,9383,15633,21883,28133,34383,40633,46883,53133,59383,65633,71883,78133,84383,90633,96883,9,50009,75009,12509,37509,62509,87509,6259,18759,31259,43759,56259,68759,81259,93759,3134,9384,15634,21884,28134,34384,40634,46884,53134,59384,65634,71884,78134,84384,90634,96884,10,50010,75010,12510,37510,62510,87510,6260,18760,31260,43760,56260,68760,81260,93760,3135,9385,15635,21885,28135,34385,40635,46885,53135,59385,65635,71885,78135,84385,90635,96885]}
Expectednull
⏱ Performance - must finish in 2000ms
Large BST with n=100 nodes; O(n) or O(n log n) solution must complete within 2 seconds.
✓ Solution runs within time limit using efficient inorder traversal.