↳
reverse the linked list, iterate through it and print, reverse it back.
↳
traverse through it using a recursive function with a printing statement after the traversal statement so when it gets to the end of the function and its returning, it will print along the way. Minder
↳
def reverse[T](seq: Seq[T]): Seq[T] = { seq match { case Nil => Seq() case head :: tail => reverse(tail) :+ head } } println(reverse(List('A', 'B', 'C', 'D', 'E'))) Minder
↳
Convert the strings to objects with each word being added as a property to speed up the lookup. I had heard of this technique but never done it myself. Minder
↳
sort the words will be done in n Log n . for each word in 1st string do binary search on other string which will run in n log n so overall complexity will be n log n. Minder
↳
Ask more specifics on the position. The recruiter gave me NO information on the available position, so I was under the impression that I was up for consideration in several positions.. Minder
↳
I can tell you what I don't got -- a job.
↳
My answer started out a simple string comparison, but then realized the algorithm needs to be a little more complex to satisfy the requirement. I turned the strings into arrays, then created a function that used a nested for loop to compare the arrays. similar to the native String.indexOf() method, only customized for the requirement. Minder
↳
You can use a hash map to count the words in the two arrays. Words with count==1 are the answer Minder
↳
with the help of addClass and removeClass function using (this)
↳
Same thing happened to me - what company asks you to do a project - aka homework... stupid and a waste of time Minder
↳
Because i'm more qualified for the job than most candidates waiting outside