Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 349301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:26:44+00:00 2026-05-12T11:26:44+00:00

The question is complicated but I will explain it in details. The goal is

  • 0

The question is complicated but I will explain it in details.

The goal is to make a function which will return next “step” of the given string.

For example

String.Step("a"); //  = "b"
String.Step("b"); //  = "c"
String.Step("g"); //  = "h"
String.Step("z"); // = "A"
String.Step("A"); // = "B"
String.Step("B"); // = "C"
String.Step("G"); // = "H"

Until here its quite easy, But taking in mind that input IS string it can contain more than 1 characters and the function must behave like this.

String.Step("Z"); // = "aa";
String.Step("aa"); // = "ab";
String.Step("ag"); // = "ah";
String.Step("az"); // = "aA";
String.Step("aA"); // = "aB";
String.Step("aZ"); // = "ba"; 
String.Step("ZZ"); // = "aaa";

and so on…

This doesn’t exactly need to extend the base String class.

I tried to work it out by each characters ASCII values but got stuck with strings containing 2 characters.

I would really appreciate if someone can provide full code of the function.

Thanks in advance.

EDIT
*I’m sorry I forgot to mention earlier that the function “reparse” the self generated string when its length reaches n.

continuation of this function will be smth like this. for example n = 3
String.Step("aaa"); // = "aab";
String.Step("aaZ"); // = "aba";
String.Step("aba"); // = "abb";
String.Step("abb"); // = "abc";
String.Step("abZ"); // = "aca";
.....
String.Step("zzZ"); // = "zAa";
String.Step("zAa"); // = "zAb";
........

I’m sorry I didn’t mention it earlier, after reading some answers I realised that the problem was in question.

Without this the function will always produce character “a” n times after the end of the step.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:26:45+00:00Added an answer on May 12, 2026 at 11:26 am

    NOTE: This answer is incorrect, as “aa” should follow after “Z”… (see comments below)

    Here is an algorithm that might work:

    each “string” represents a number to a given base (here: twice the count of letters in the alphabet).

    The next step can thus be computed by parsing the “number”-string back into a int, adding 1 and then formatting it back to the base.

    Example:

    "a" == 1 -> step("a") == step(1) == 1 + 1 == 2 == "b"
    

    Now your problem is reduced to parsing the string as a number to a given base and reformatting it. A quick googling suggests this page: http://everything2.com/title/convert+any+number+to+decimal

    How to implement this?

    • a lookup table for letters to their corresponding number: a=1, b=2, c=3, … Y = ?, Z = 0
    • to parse a string to number, read the characters in reverse order, looking up the numbers and adding them up:
      • “ab” -> 2*BASE^0 + 1*BASE^1
      • with BASE being the number of “digits” (2 count of letters in alphabet, is that 48?)

    EDIT: This link looks even more promising: http://www.citidel.org/bitstream/10117/20/12/convexp.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is complicated, but I will do my best to explain my question. Object
My question is slight complicated. Let me try to explain it thoroughly, but if
Hello I have a question that could seem complicated. But I will try to
The question is a bit complicated so I will try and explain. I have
I'm new in Django and Python and I'm stuck! It's complicated to explain but
So this is a bit complicated situation, so I will try to explain what
This question will probably end in a facepalm, but I've tried for a while
Ok, I know the title is quite complicated but the question is hard to
EDIT: This got way too complicated, I will migrate this question to another question
OK, so it's a badly phrased question. But it's hard to explain in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.