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

  • Home
  • SEARCH
  • 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 9120503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:38:32+00:00 2026-06-17T05:38:32+00:00

Let’s say there is a certain way of encrypting strings: Append the character $,

  • 0

Let’s say there is a certain way of encrypting strings:

  • Append the character $, which is the first character in the alphabet, at the end of the string.
  • Form all the strings we get by continuously moving the first character to the end of the string.
  • Sort all the strings we have gotten into alphabetical order.
  • Form a new string by appending last character of each string to it.

For example, the word FRUIT is encrypted in the following manner:

We append the character $ at the end of the word:
FRUIT$

We then form all the strings by moving the first character at the end:
FRUIT$
RUIT$S
UIT$FR
IT$FRU
T$FRUI
$FRUIT

Then we sort the new strings into alphabetical order:
$FRUIT
FRUIT$
IT$FRU
RUIT$F
T$FRUI
UIT$FR

The encrypted string:
T$UFIR

Now my problem is obvious: How to decrypt a given string into it’s original form.

I’ve been pounding my head for half a week now and I’ve finally run out of paper.

How should I get on with this?

What I have discovered:

if we have the last step of the encryption:

$FRUIT
FRUIT$
IT$FRU
RUIT$F
T$FRUI
UIT$FR

We can know the first and last character of the original string, since the rightmost column is the encrypted string itself, and the leftmost column is always in alphabetical order. The last character is the first character of the encrypted string, because $ is always first in the alphabet, and it only exists once in a string. Then, if we find the $ character from the rightmost column, and look up the character on the same row in the leftmost column, we get the first character.

So what we can know about the encrypted string T$UFIR is that the original string is F***T$, where * is an unknown character.

There ends my ideas. Now I have to utilize the world-wide-web and ask another human being: How?

You could say this is homework, and being familiar with my tutor, I place my bets on this being a dynamic programming -problem.

  • 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-06-17T05:38:33+00:00Added an answer on June 17, 2026 at 5:38 am

    This is the Burrows-Wheeler transform.

    It’s an algorithm typically used for aiding compression algorithms, as it tends to group together common repeating phrases, and is reversible.

    To decode your string:

    Number each character:

    T$UFIR
    012345
    

    Now sort, retaining the numbering. If characters repeat, you use the indices as a secondary sort-key, such that the indices for the repeated characters are kept in increasing order, or otherwise use a sorting algorithm that guarantees this.

    $FIRTU
    134502
    

    Now we can decode. Start at the ‘$’, and use the associated index as the next character to output (‘$’ = 1, so the next char is ‘F’. ‘F’ is 3, so the next char is ‘R’, etc…)

    The result:

    $FRUIT
    

    So just remove the marker character, and you’re done.

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

Sidebar

Related Questions

Let's say I have a method in java, which looks up a user in
Let's say I have a string like this: var str = /abcd/efgh/ijkl/xxx-1/xxx-2; How do
Let's say I need to save certain data, like an array, to NSUserDefaults. If
Let's say I wanted to remove vowels from HTML: <a href=foo>Hello there!</a>Hi! becomes <a
Let's say I have an abstract parent class called shape, and that there are
Let me frame it this way.. Say I have an application server running on
let's say.. I have the following java bean. Case1: (Student Bean) Integer id; String
Let's say I have a Job Scheduler which has 4 consumers A, B, C
Let's say I got this string: $str = alemylaife; (I know it's misspelled, all
Let's say the rule is as follows: .largeField { width: 65%; } Is there

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.