Depends on chain growth under full compression as to how many links you need, which is why I never trust ‘the rules’.
I just install the chain with the connecting link very lightly connected, but the bike in big / big chain ring and sprocket combos, unhook the shock from one mount and move the shock out of the way and then move the rear wheel to bottom out position. From there I roughly decide on the chain length but if in doubt go a link too long. Then roughly adjust the B-tension screw as that will also have a slight impact on chain length requirement. If you are not sure if you can take another link out, you can mimic removing a link by folding the chain over one link with needle nose pliers. Once the chain looks good, properly connect it and fine tune the B-tension after installing the shock (or pressuring if removing the shock bolt and pivoting the shock out of the way wasn’t an option).
Significantly more of a faff than following the rules but at least you will know that the chain length is 100% dialed. I’m sure that the rules are fine for road bikes and hardtails.
If the chain snapped, I wouldn’t trust that the old chain wasn’t too short. That may be the reason that it snapped!