Prototype: implement prototype(List<List<String>> allowed) returning List<String> with a direct baseline.

Final: implement solve(List<List<String>> allowed) with the mechanism and bounds described above. Choose one string per inner list with no string reused; return the lexicographically smallest full assignment in input-position order, or null. Empty outer input returns an empty list; an empty option list makes completion impossible. Duplicate options count once. Java ordering is String.compareTo (UTF-16 lexical order). Both stages have the same observable contract. The prototype may use the simpler method; final must use the target data structure.

All methods are static members of Exercise.

Drag or use the arrow keys to resize. Home collapses the question; End collapses the editor. Enter or double-click resets the split.
Loading editor…
No results yet.

Complete the starter code, then run the checks.
Results and errors will appear here.

Java runs on this device with CheerpJ 4.3.