Chef And New Year
All submissions for this problem are available.Chef is a competitive programming enthusiast. He started his NEW Year with solving interesting problems. So, if someone wishes Chef on New Year, he asks him a problem to solve. Chef gave you two string S1 and S2 each of length $N$. He asks to permute any substring of string S2 any number of times ( including 0 ). If it is possible, that string S1 can be get from S2 then Chef will say "Happy New Year". ###Input: - First line will contain $T$, number of testcases. Then the testcases follow. - Each testcase consist of $N$ denoting length of binary string, second line consist of $S1$ and third line consist of $S2$. ###Output: For each testcase, output in a single line "Happy New Year" with quotes if S1 can be get from S2, otherwise print '-1'. ###Constraints - $1 \leq T \leq 100$ - $2 \leq N \leq 10^5$ ###Sample Input: 2 4 1010 0101 3 111 000 ###Sample Output: "Happy New Year" -1
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.