Monday, January 25, 2016

F面经prepare：strstr变种

* Given an integer k>=1 and two strings A and B (length ~n each);
* Figure out if there is any common substring of length at least k.
* (i.e. any string of length at least k, that is a substring of both A and B)
*
* A="facebook", B="bookshelf", k=3 ==> true
^^^ ^^^
* A="facebook", B="bookshelf", k=4 ==> true
^^^^ ^^^^
* A="facebook", B="bookshelf", k=5 ==> false