At BuildForge, a test is considered flaky if it has both passed and failed across multiple CI runs. Given a list of test execution records, return the names of all flaky tests in lexicographical order.
Implement a function that scans the records and detects which tests are inconsistent over time.
records, a list of pairs [test_name, status]
test_name is a non-empty stringstatus is either "pass" or "fail"Example 1
Input: records = [["login", "pass"], ["checkout", "fail"], ["login", "fail"], ["search", "pass"]]
Output: ["login"]
login appears once as pass and once as fail, so it is flaky.
Example 2
Input: records = [["a", "pass"], ["b", "fail"], ["a", "pass"], ["b", "fail"]]
Output: []
Neither test changes outcome, so no test is flaky.
1 <= len(records) <= 10^51 <= len(test_name) <= 100"pass" or "fail"records = [["login", "pass"], ["checkout", "fail"], ["login", "fail"], ["search", "pass"]]Output["login"]Why`login` appears with both `pass` and `fail`, while the other tests appear with only one status.records = [["a", "pass"], ["b", "fail"], ["a", "pass"], ["b", "fail"]]Output[]WhyBoth tests are consistent across all runs, so none are flaky.records = [["api", "fail"], ["ui", "pass"], ["api", "pass"], ["ui", "fail"], ["api", "fail"]]Output["api", "ui"]WhyBoth `api` and `ui` have been observed with both possible outcomes.1 <= len(records) <= 10^51 <= len(test_name) <= 100Each record is a pair [test_name, status]status is either "pass" or "fail"Test names may repeat many timesReturn unique flaky test names sorted lexicographicallydef find_flaky_tests(records):