Added solution for k-Ary Strings