Add the backgrack Java solution based on C++