Coding exercise from ByteCode
Platform | Build status |
---|---|
Ubuntu 18.04 LTS |
Find the smalles substring within the given string such that it contains the target substring in any order.
The first argument os the original string while the second is the target string. The former is searched for the smallest substring containing the letters of the second argument in any given order.
$ ./stringWindow "aabeaadad" "aed"
The substring 'eaad' from 'aabeaadad' contains 'aed'
$ ./stringWindow "aabeaadad" "aaa"
The substring 'aada' from 'aabeaadad' contains 'aaa'
$ ./stringWindow "aaaaaa" "a"
The substring 'a' from 'aaaaaa' contains 'a'
$ ./stringWindow "aghetyqqqsaa" "aaghe"
The substring 'ghetyqqqsaa' from 'aghetyqqqsaa' contains 'aaghe'