#K6081. Find Consecutive Digit Segments
Find Consecutive Digit Segments
Find Consecutive Digit Segments
Given a string, your task is to extract and print all segments that contain at least three consecutive digits. A segment is defined as a contiguous sequence of decimal digits. If the input string does not contain any segment with three or more consecutive digits, print -1.
Input Example: hello1234world5670abc890123
Output Example: 1234 5670 890123
Use regular expressions or similar techniques available in your programming language to solve this problem efficiently.
inputFormat
The input consists of a single line containing the string.
outputFormat
If segments with three or more consecutive digits exist, output them in the order they appear in the string separated by a single space. Otherwise, output -1.
## samplehello1234world5670abc890123
1234 5670 890123