问题描述:
1005 Programming Pattern (35 分)
Programmers often have a preference among program constructs. For example, some may prefer if(0==a)
, while others may prefer if(!a)
. Analyzing such patterns can help to narrow down a programmer's identity, which is useful for detecting plagiarism.
Now given some text sampled from someone's program, can you find the person's most commonly used pattern of a specific length?
Input Specification:
Each input file contains one test case. For each case, there is one line consisting of the pattern length N (1≤N≤1048576), followed by one line no less than N and no more than 1048576 characters in length, terminated by a carriage return \n
. The entire input is case sensitive.
Output Specification:
For each test case, print in one line the length-N substring that occu