PROBLEM OF THE DAY: 03/10/2023 | Column name from a given column number
source link: https://www.geeksforgeeks.org/videos/problem-of-the-day-03102023-column-name-from-a-given-column-number/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Column name from a given column number
Welcome to the daily solving of our PROBLEM OF THE DAY with Siddhartha Hazra. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Strings but will also help you build up problem-solving skills.
In this problem, we are given, a positive integer, return its corresponding column title as appear in an Excel sheet.
Excel columns has a pattern like A, B, C, … ,Z, AA, AB, AC,…. ,AZ, BA, BB, … ZZ, AAA, AAB ….. etc. In other words, column 1 is named as “A”, column 2 as “B”, column 27 as “AA” and so on.
Example :
Input:
N = 28
Output: AB
Explanation: 1 to 26 are A to Z. Then, 27 is AA and 28 = AB.
Give the problem a try before going through the video. All the best!!!
Problem Link: https://practice.geeksforgeeks.org/problems/column-name-from-a-given-column-number4244/1
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK