-
Strings as input
Implement an algorithm that takes two strings as input, and returns the intersection of the two, with each letter represented at most once. Speed it up and test it.
-
a(x) + a(y) = M
Given a1, a2, .... a(n) integers & M, return true or false if there exist a(x) + a(y) = MOnce you're done, do it using a hash table.
-
How can you traverse a matrix of m lines and n columns in a zig-zag way ?
Example : 1)m = 3,n = 2 a11 a12 a21 a22a31 a32Output : a11 a21 a12 a31 a22 a322) m = 3, n = 4a11 a12 a13 a14a21 a22 a23 a24a31 a32 a33 a34Output : a11 a21 a12 a31 a22 a13 a32 a23 a14 a33 a24 a34