Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2017
    Posts
    1
    Rep Power
    0

    Post Morse code - advanced version

    Need programming help for the following question.

    Step One
    The program is passed two messages in the form of strings. These messages have been converted to
    Morse code tokens. The goal is to find all of the possible unique sequences of remaining tokens after
    removing the second message's tokens from the first message's tokens. There are 3 different types of
    tokens in the Morse code message.
     Dot (*)
     Dash (-)
     Blank (_)
    Every letter in the message is separated by a single blank character (_) and every word is separated by 3
    blank characters (___).
    Example:
     Given: AB
    o *-_-***
     Remove: R
    o *-*
     There are 6 different ways to remove R from AB, we will call these deletion paths.
    o X X _ - X * *
    o X X _ - * X *
    o X X _ - * * X
    o X - _ X X * *
    o X - _ X * X *
    o X - _ X * * X
     But there are only 2 possible unique sequences of remaining tokens within the set of deletion
    paths.
    o _ - * *
    o - _ * *
     So the final result for this example would be 2.
    Write a program that can calculate the number of possible unique sequences of remaining tokens for
    removing one Morse code message from another. This program should be able to solve the example
    below in under 10 seconds.
     Given: Hello World
    o ****_*_*-**_*-**_---___*--_---_*-*_*-**_-**
     Remove: Help
    o ****_*_*-**_*--*
     ANSWER: 1311
    Step two
    Using the set of possible unique sequences of remaining tokens from step one, find the possible unique
    sequences of remaining tokens where you must remove a second set of tokens from each of the
    sequences. All remaining tokens would be kept in the same order when removing the second sequence
    of tokens. Return all of the possible, unique sequences of remaining tokens after removing both
    messages.
    Example:
     Given: ABCD
    o *-_-***_-*-*_-**
     Remove: ST
    o ***_-
     Then Remove: ZN
    o --**_-*
     One solution path would look like:
    o Start:
     * - _ - * * * _ - * - * _ - * *
    o Remove ST:
     x - _ - x x * x x * - * _ - * *
    o Then Remove ZN:
     x x _ x x x x x x x - * x x x *
    o The sequence of remaining characters
     _ - * *
     There are 5 sequences of remaining characters for this example:
    o _-**
    o _*-*
    o -_**
    o *_-*
    o *-_*
    Write a program that will find all of the possible unique sequences of remaining characters after
    removing 2 Morse code messages from an original message. This program should be able to calculate all
    of the sequences in the example below in less than 60 seconds and return the total number of distinct
    and valid sequences found.
     Given: The Star Wars Saga
    o -_****_*___***_-_*-_*-*___*--_*-_*-*_***___***_*-_--*_*-
     Remove: Yoda
    o -*--_---_-**_*-
     And Remove: Leia
    o *-**_*_**_*-
     Expected Answer: 11474
    Program Specifications
     Input: Three command-line arguments denoting the original message, the first hidden message,
    and the second hidden message. The three messages will be in Morse code using the
    representation described here.
     Expected Output: Total number of distinct and valid remaining token sequences in the original
    message.
     Bounds: Original Message less than 100 Morse code characters.

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Morse code - advanced version

    Ok, what have you tried?
    What specific java programming questions do you have?
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Morse code - advanced version

    First, this is not advanced. Second, you need to show your code and ask questions about where you are having problems. And please place your code between code tags. See the BB Codes section below for more info.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,001
    Rep Power
    33

    Default Re: Morse code - advanced version

    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    25

    Default Re: Morse code - advanced version

    Quote Originally Posted by jim829 View Post
    First, this is not advanced.
    Agreed. Moved to an appropriate section.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Help with Morse Code program please.
    By Steffer_Neffer_15 in forum New To Java
    Replies: 3
    Last Post: 11-03-2013, 12:42 PM
  2. [HELP] morse code java program
    By g_who in forum New To Java
    Replies: 14
    Last Post: 10-24-2012, 05:15 PM
  3. Morse Code Help Please!!
    By javaa in forum New To Java
    Replies: 25
    Last Post: 09-28-2012, 03:28 AM
  4. Morse code translation?
    By Koba in forum New To Java
    Replies: 6
    Last Post: 10-09-2011, 11:48 PM
  5. Morse Code
    By Jamison5213 in forum New To Java
    Replies: 6
    Last Post: 04-14-2010, 04:56 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •