1. A document checking apparatus comprising: a memory; and a processor coupled to the memory, wherein the processor executes a process comprising: extracting character strings from a target document and a confidential document that becomes a comparison target when determining similarity between documents; first determining, based on appearance positions of the character strings extracted at the extracting, whether another character string is within a predetermined range extending from a target character string toward either front or rear of the documents, to determine an element of feature element information corresponding to a pair of the target character string and the another character string within the predetermined range; generating, when it is determined at the first determining that there is the another character string, the feature element information having a specific value in the element determined at the first determining; comparing the feature element information of the target document and the feature element information of the confidential document generated at the generating; and second determining whether a number of common elements having the specific value commonly among the feature element information of the target document and the confidential document is not less than a first similarity determination number to determine similarity between the target document and the confidential document on the basis of the determination result.