Facebook Puzzle (liarliar) Test-cases

Below are some of the test cases I picked (and tested against) from the liarliar Facebook discussion forum.

Test-case 1
http://paste2.org/p/870660
$ javac LLTest.java
$ java LLTest 100000 20090727 >1.in
$ java liarliar 1.in
50091 49909

Test-case 4
http://paste2.org/p/870663
$ java -Xmx512m LLTest4 1000000 1 >4.1.in
$ md5sum 4.1.in b91b728927d43da2c745f4ff2a57953b 4.1.in
$ java liarliar 4.1.in
500112 499888

Test-case 5
http://paste2.org/p/870666
$ java -Xmx512m LLTest4 1000000 1 >4.1.in
$ md5sum 4.1.in b91b728927d43da2c745f4ff2a57953b 4.1.in
$ java liarliar 4.1.in
500112 499888

Above test-cases are not created by me. Credits to David Eisenstat.

Comments

  1. thanks dude! :)

    ReplyDelete
  2. hi binghan, can you please tell me whether test case 1 output (50091 49909) is right?
    I checked on my solution and its giving 50089 49911.. but takes more than 10 minutes to run on such a big data..
    is it acceptable?

    ReplyDelete
  3. Hi sol0, the output should be correct. 10 minutes is too long, you might want to optimize your algorithm to fit into less than 5 seconds.


    You can follow the discussion here http://on.fb.me/imA0zv. You will most people got it around 2 second.

    ReplyDelete

Post a Comment

Popular posts from this blog

[Azure Websites PHP] Cross Domain request results in blank response page after Preflight HTTP OPTIONS

[Magento] Create Contact Form with Dynamic Recipient