
OA Question 1
Given two strings containing only English letters, write an algorithm to count the number of times the second string appears in the first (ignoring case).
importation
First line: string parent
.;
Second line: string sub
.
exports
printable sub
exist parent
in the output, and if not, output the number of times 0
.
OA Question 2
Given a length of n
The video string of the video
and an integer array of size 26. engagementArray
(0 for non-viral segments, 1 for viral segments), and a threshold k
The Counts all non-empty items that contain no more than k
Number of **unique** substrings of non-viral segments.
Input Example
video = "abc"
engagementArray = [0, 1, 0, 1, 1, 0, ...]
k = 2
exports
5
Reference reading:Amazon SDE II OA Prep
For OA ghostwriting services, please Contact Us.