You are helping Amazon's Quality Assurance engineers process bug reports generated from automated testing logs across various devices and services. Each log contains an integer bug code, and a single test session may include duplicate bug codes if the same issue is triggered multiple times.
To effectively prioritise debugging and resolution, the following rules are applied:
The task is to sort the bug codes in order of decreasing importance, using the above rules. This means bugs with lower frequency come first. If frequencies are equal, bugs with lower code numbers come first.
Hard