this is spoj problem please give a right a best approach for this problem and solution too. Problem link WOWSUBSTR