The Germans lost the Battle of the Atlantic — trying to strangle the flow of war materials to the UK and Russia. Of 1,158 boats built, Germany lost 781 submarines and 30,000 of 40,000 submariners.
American submarines accomplished with the Japanese Empire what the Germans failed to do in the Atlantic Theater of Operations and with with lesser forces deployed. The US Navy sent 288 submarines of all types against Japan. The US Navy submarine force represented 1.6% of US Navy personnel. The US Navy lost 52 boats with a casualty rate of 22% killed — highest of all the US military branches. It destroyed 2/3 of the Japanese merchant fleet and 1/3 of the IJN afloat on 7 December 1941. American submariners won their war in the Pacific Theater.
In the Atlantic if the Germans had stoppled building the type VII and IX, and went straight to the type XXI, which they could have done, we would have lost that battle.