The Typical Way to Make an Acronym Out of a Phrase Is to Take the First Letter of Each Word: TTWMAOPITFLEW
. howeveR, sometimEs, you can make an acronym of random leTters In a seNtence such As like this: RETINA
. The only condition is that the letters have to be in the correct order. For instance:
LORD
can be acronymised fromHello World
:heLlO woRlD
LEOD
cannot be acronymised fromHello World
, as nol
s are beforee
Your task is to take two strings as input as to determine if one can be acronymised into the other.
The first input, the phrase, will only contain letters (A-Z
or a-z
) and spaces, and the second input, the acronym, will only contain letters (A-Z
or a-z
). The acronym will always be shorter, or of equal size, to the phrase, and both the acronym and the phrase will be, at minimum, 1 letter long. You may choose which case (upper or lower) you want the inputs to be.
You may choose any two values to represent true
and false
, as long as those values are consistent.
This is code-golf so the shortest code in bytes wins
Examples
HELLO WORLD, LORD -> true
CODE GOLF AND CODING CHALLENGES, DANGLE -> true
SANDBOX FOR PROPOSED CHALLENGES, CODE -> false
HELLO WORLD, LLLD -> true
HELLO WORLD, LLDL -> false
NEW YORK POLICE DEPARTMENT, NOODLE -> false
MASSACHUSETTS INSTITUTE OF TECHNOLOGY, MUTTON -> true
BOB, BOB -> true
PRESIDENT OF THE UNITED STATES, I -> true