You're developing a system where user input needs to be validated against a predefined list of acceptable values. How would you use arrays or strings to handle this validation effectively?

  • Apply binary search on a sorted list
  • Implement a lookup table
  • Use a switch-case statement
  • Utilize regular expressions
A lookup table provides efficient validation against predefined values, improving system robustness.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *