All Problems

Problem title

Difficulty

Avg time to solve

Clone a Linked List with random pointers

Easy

--

Most Cost Efficient Car

Easy

10 mins

All Root to Leaf Paths In Binary Tree.

Moderate

25 mins

First unique character in a string

Moderate

15 mins

Partition String

Moderate

25 mins

AVL Tree: Insert

Easy

15 mins

Excel Equivalent of a Decimal Number

Moderate

25 mins

Lexicographically Smallest Array

Easy

15 mins

Look & Say Sequence

Easy

10 mins

Leftmost and rightmost nodes in a binary tree

Easy

20 mins

Problem

Submissions

Avg. time to solve

25 min

Success Rate

50%

Problem Statement

```
1. The Excel equivalent of 1 is "A", the Excel equivalent of 2 is "B" ……………, the Excel equivalent of 26 is "Z".
2. The Excel equivalent of 27,28…,52 is "AA", "AB"…."AZ" respectively.
3. The Excel Equivalent of 53,54….78 is "BA", "BB"….."BZ".
4. The pattern shown above can be used to find the excel equivalent of any positive number.
5. There is only one Excel Equivalent for a given positive number.
```

```
The first line of input contains an integer ‘T’ denoting the number of test cases.
The first and only line of each test case contains a number 'N' of which the Excel Equivalent is required to be found.
```

```
For each test case, return the Excel equivalent of a given number in a separate line.
```

```
You don't need to print anything, it has already been taken care of. Just implement the given function.
```

```
Can you solve this in logarithmic time and space complexity?
```

```
1 <= T <= 1000
1 <= N <= 10^15
Time limit: 1sec
```

```
2
2
9
```

```
B
I
```

```
In test case 1, the Excel Equivalent of 2 is B.
In test case 2, the Excel Equivalent of 9 is I.
```

```
2
27
31
```

```
AA
AE
```

```
In test case 1, the Excel equivalent of 26 is Z and therefore the Excel equivalent of 27 is AA.
In test case 2, the Excel equivalent of 27 is AA and therefore the Excel equivalent of 31 will be AE.
```

Java (SE 1.8)

Console

Sample Test Case

Custom Test Case

Download Test Cases

Test Case 1

Test Case 2

Test Case 3

Saving Code...

Full Screen Mode

Change Theme

Solution submission not allowed

Save Code

Reset Code