EARNINGS PER SHARE (Tables)
12 Months Ended
Jun. 30, 2019
Earnings Per Share [Abstract]  
Computation of basic and diluted earnings (loss) per share The following table sets forth the computation of basic and diluted earnings per share for the periods indicated (in thousands, except per share data):
 Years Ended June 30,
 2019 2018 2017 
Numerator:
Net Income$322,694 $196,290 $257,506 
Denominator:
Weighted-average shares used in computing basic net income per share71,435 77,179 81,478 
Add—dilutive potential common shares:
Stock options87 1,074 1,670 
Restricted stock units80 78 104 
Weighted-average shares used in computing diluted net income per share71,602 78,331 83,252 
Net income per share of common stock:
Basic$4.52 $2.54 $3.16 
Diluted$4.51 $2.51 $3.09 
Potential shares of common stock excluded from diluted per share calculation The following table summarizes the total potential shares of common stock that were excluded from the diluted per share calculation, because to include them would have been anti-dilutive for the period (in thousands):
 Years Ended June 30,
 2019 2018 2017 
Restricted stock units— 18