72: Second minimum node in a binary tree

Given a binary tree, return a second smallest value. Return -1 if there's no second smallest value

 

Example 1

Input:        1  
             / \
            1   1

Output: -1

Example 2

Input:        1  
             / \
            2   3

Output: 2
Difficulty:Easy
Topic:Array
Problem #:72