Google 实习电面

Today I had my first coding phone interview with Google.

I was asked https://leetcode.com/problems/minimum-window-subsequence/ (premium)

This got me confused and finally I could only come up the brute force solution, which is get all the possible substring and check if it has all the alphabets in the same order which is of O(n3)

Given sequence of numbers from 0 to X, where
0 = 000000,
…,
999_999 = 999999,
1_000_000 = 00000A,
1_000_001 = 00001A,
…,
_ = 99999A,
_ = 00000B,
…,
_ = 00000Z,
_ = 00001Z,
…,
_ = 99999Z,
_ = 0000AZ,
…,
_ = 9ZZZZZ,
_ = AZZZZZ,
…,
X - 1 = YZZZZZ,
X = ZZZZZZ.
Write a function to encode N (from 0 to X) in this format.