Problem · String

Find Words in String Not in Subsequence (MLE :)

Learn this problem
EasySalesforceNEW GRADOA
See Salesforce hiring insights

Problem statement

Given two strings s and t, where t is a subsequence of s. This means that the words in t appear in s in the same order but not necessarily consecutively.

Your task is to find the words in s that are not in t, and output them in their original order.

Function

findWordsNotInSubsequence(s: String, t: String) → String[]

Examples

Example 1

s = "I like cheese"t = "like"return = ["I", "cheese"]
These words are in s but not part of t.

More Salesforce problems

drafts saved locally
public String[] findWordsNotInSubsequence(String s, String t) {
  // write your code here
}
s"I like cheese"
t"like"
expected["I", "cheese"]
checking account