Print a string consisting only of characters that are only in the first line.

String stringSub(String s1 , String s2); 

If there are 2 lines

s1 = "199578"

s2 = "997"

=> Result "158";

Closed due to the fact that off-topic participants DreamChild , Vladimir Martyanov , Pavel Parshin , Saidolim , YuriySPb 31 Mar '16 at 20:41 .

  • Most likely, this question does not correspond to the subject of Stack Overflow in Russian, according to the rules described in the certificate .
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • five
    I vote for the closure of this issue as not relevant topic, because the work for the author - DreamChild
  • The author would first have to figure out the "vachetany" ... - Vladimir Martyanov

1 answer 1

  1. Break both strings into arrays of letters.
  2. In the loop, spell the first line.
  3. For each letter, check its correspondence with one of the letters of the second line. Looped by letter or contains method
  4. If there is a match, do not add this letter to the resulting array.