Nearly Optimal Algorithms for Level Set Estimation