Line 1: error: class, interface, or enum expected [in MainClass.java]

Line 1: error: class, interface, or enum expected [in MainClass.java]
The first time you brush leecode and paste in the solution given will report this error.
add a bracket at the beginning and end of the public class Solution to the first line.

Read More: