You're building a feature flag system. Flags are checked thousands of times per second. A dictionary-backed solution with `String` keys works but a colleague proposes using an enum. What is the runtime advantage?
-
A
Enums use less memory than Strings on the heap
-
B
Enum cases are compared as integers, making switch exhaustive and O(1) with no hashing
-
C
Enums automatically cache their associated values
-
D
String keys are O(n) in dictionaries