Prototype: implement prototype(String text, String pattern) returning List<Integer> with a direct baseline.

Final: implement solve(String text, String pattern) with the mechanism and bounds described above. Return all ascending match starts measured in Unicode code points, not UTF-16 char offsets. Compare exactly, preserving case and normalization form. An empty pattern matches every code-point boundary, including the end. ("ababa","aba") gives [0,2]. 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.