Hey!
The direct translation would be “위대한 사람들은 같은 생각을 한다”, but we don’t use this phrase in Korean and it just sounds a lil awkward.
A more natural way of saying this would be something like “너도 나랑 같은 생각을 했구나!” Which roughly translates to “oh, you’ve thought of the same thing as me!”
Hope this helped!