ThinkBridge interview question

Practice DSA Question , based on Array and string