Amazon Onsite Question
Anonymous User
2857

Check if word can be made from { A, B } {B, A} {B, X} (Y, C}

Input : BABY { A, B } {B, A} {B, X} (Y, C}
Output: True

Input : BABY {A, B } {A, B} {L, E}
Output: False

Example :
{ A, B } {B, A} {B, X} (Y, C}, BABY => True
As Each character comes in different record so word BABY can be made byt it.

{A, B } {A, B} {L, E} , BABY = ABLE= false
As L and E are in same record.

{A, B } {A, B} {L, E} {E, O } = ABLE = true

Comments (11)