Merge Two Sorted Strings Lexicographically

In this lesson, we'll learn how to merge two strings lexicographically.

What does “Merging Two Sorted Strings Lexicographically” Mean?

Lexicographical means that something is organized according to alphabetical order.

Lower case letters are different from upper case letters and are therefore treated as different elements. All upper case letters come before lower case letters. Alphabetic sorting is as follows: $A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z$

In this task, we’re merging two strings (that are themselves sorted). Have a look at the illustration below:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.