Chef and Data Transfer
All submissions for this problem are available.
One day Chef and his friend Alice decide to build a device which will transfer the data between them. The data is transferred in binary form i.e. 1 & 0.
When the device was built they tried to test it. While testing the device they found out that due to noise in the data transferring channel they didn’t receive the data in exactly the same form, some of the digits of the data were misplaced or missing. So Chef and Alice decided that chef will fine tune the device and send the same data to Alice for N number of times and the data with lowest error will be accepted.
Your task is to help Alice find the ith sent data for which the minimum error is received.
Given that %error = (total no of wrong digits / total number of digits) × 100
- The first line of input contains two integer N denoting the numbers of times the data was sent and L denoting the length of the data sent.
- The second line contains the correct data which is to be transferred.
- Each of the following N lines contain the data sent by the device in the ith attempt.
OutputOutput a single line containing the string which has the lowest error.
Note:If there are more than one possible output with the same minimum error then output the first string which has the minimum error.
- 1 ≤ N ≤ 103
- 1 ≤ L ≤ 103
2 5 11111 10101 11110
|Tags||array-string, ense2018, rahul_ojha_07|
|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, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, COB, FS|
Fetching successful submissions