"Longest Duplicate Substring" hard task No 1044 not accepted bruteforce solution
This commit is contained in:
18
1044-longest-duplicate-substring_test.go
Normal file
18
1044-longest-duplicate-substring_test.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLongestDupSubstring(t *testing.T) {
|
||||
assert.Equal(t, "ana", LongestDupSubstring("banana"))
|
||||
assert.Equal(t, "", LongestDupSubstring("abcd"))
|
||||
assert.Equal(t, "aaa", LongestDupSubstring("aaaa"))
|
||||
assert.Equal(t, "", LongestDupSubstring(""))
|
||||
assert.Equal(t, "", LongestDupSubstring("a"))
|
||||
assert.Equal(t, "x", LongestDupSubstring("xx"))
|
||||
assert.Equal(t, "xx", LongestDupSubstring("xxx"))
|
||||
assert.Equal(t, "bananab", LongestDupSubstring("bananabananab"))
|
||||
assert.Equal(t, "sfd", LongestDupSubstring("polxtvqlurgobbzbjcjsupskvzmtuveuavrzcxaifmdwqjbuejdasuxcvsupqnucorfawncjqkbakilhiekavhmsjbtlsfydijafxhgrgbsswtnvdquwokcliaxevairergwdtndsibiulqiutkcwsqpzuyypnhiowgvkkdbpkoyvgwyuqcokjnxluamwnuhqjtaossezwxvkpdkqcleqjkelcludtbigxkueupnxjncrbgvdrsdpppqqcopnwadqsxkvlkghfmtvdeygpyxamvxhmmaunxskgnenobvnzizbxwrjeedisrgzykoaidiffzqzsmirxkvfwmtifywamcpxziyjohcudzelgbmdgiaqwnzdbkwbhdioiokaivzlzscshrvbmggdztjuimribrgmdlcctvldbcxwpqnqbkzrcayqdqraobqcgoxxocclasphcjcydpkgkqhrmmxtklpxfxnrgnzczjxanaltnjhwfatgryqhcllemgqcchiagizpdgiqioqyhrpattutmuotrcwtxvdqzzsomofizebbqrgwruydyawsssjkakjpjlzmfhmjetymftxrhilpcgfqyoohyydnodfortlkeoncmfkdraiqydxcodyapjaxumjwczwmthrcecfgsswwtnyqurvggamjbsjdzmcuyefwnsrnhhpusfdsxbsrsrywbccullupdbovnmzluqsfdhqbef"))
|
||||
}
|
||||
Reference in New Issue
Block a user