You can loop through the values of all the "Fields A"s in code. Create a flag field in your schema named "FieldBShow". If any of the "Field A"s are set to "A", then set that flag to true. If none of them are, set it to false. Then create a formatting rule that hides "Field B" based on whether or not "FieldBShow" is true/false.
You can do this by creating the code in the changed event for the repeating section of your schema.