Adblock breaks this site

A riddle for you lot

Discussion in 'Technology' started by Noam, May 5, 2014.

  1. Noam

    Noam Apostle of the Setting Sun
    $50 USD Donor New Competition Winner

    Joined:
    Jul 27, 2011
    Posts:
    2,993
    Referrals:
    1
    Sythe Gold:
    0
    Discord Unique ID:
    688859853535313930
    Discord Username:
    sarbaz#8969
    Two Factor Authentication User Gohan has AIDS
    A riddle for you lot

    F(string s, string b) returns the number of appearances of b as a substring of s times len(b).

    Given an arbitrary string s, find a palindrome b for which F(s, b) is maximal in time O(n log n) where n = len(s)


    Example: For the string "aaa"
    F("aaa", "a") = 3*1 = 3
    F("aaa", "aa") = 2*2 = 4
    F("aaa", "aaa") = 1*3 = 3

    Hence the solution is "aa"
     
< Keyboard and mouse not working | Some media not loading? >


 
 
Adblock breaks this site