is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
private static bool equalCharactersArray(int[] list1, int[] list2)
- Mohamed Salah January 17, 2017{
for (int i = 0; i < list1.Length; i++)
{
if (list1[i] != list2[i])
{
return false;
}
}
return true;
}
public static List<int> findIndicesOfString(String haystack, String needle)
{
int count = 0;
int n = haystack.Length;
int m = needle.Length;
List<int> anagramIndices = new List<int>();
if (n < m | m == 0 | m == 0)
{
return anagramIndices;
}
//array of count of all characters
int[] textHist = new int[256];
int[] patHist = new int[256];
//initial histogram window of size m
int i = 0;
for (i = 0; i < m; i++)
{
patHist[needle[i]]++;
textHist[haystack[i]]++;
}
//search
do
{
if (equalCharactersArray(textHist, patHist))
{
Console.WriteLine("anagram found : " + haystack.Substring(i - m, needle.Length));
anagramIndices.Add(i-m);
count++;
}
//move window by 1 position to the right and check for anagram in the next pattern
textHist[haystack[i]]++;
textHist[haystack[i - m]]--;
} while (++i < n);
return anagramIndices;
}