All Tracks Problem

Micro and Messages
Tag(s):

Very-Easy, 非常に簡単

Problem
Editorial
Analytics

Micro has made a new search algorithm. What it does is check whether the query string is a subsequence of the search string or not. A string $$A$$ is considered a subsequence of string $$B$$ if some characters from $$B$$ can be deleted so that it becomes equal to $$A$$.

Micro ran his algorithm on a list of messages he has and got some output but now he needs to verify it. Help Micro verify the output by doing a search on the same list of messages. String he queried for is "hack" (without quotes).

Input Format:

Table : Messages

Field Type
Content text
id integer

Sample:

Content id
hacker 1
hacak 2
happy 3

Output:

Content id
hacker 1
hacak 2

Note: Output should be printed in increasing order of id.

Constraints:

All strings in Content field consists of lower case English alphabets.

Explanation

String "hack" appears as a subsequence in strings "hacker" and "hacak".

Time Limit: 1 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: MySQL, PostgreSQL, MSSQL, Oracle Database

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

Notifications
View All Notifications