Home Tutorialhelp Comment I need help programing this promblem

 
 

Comment

paryoo
I need help programing this promblem,
October 2, 2008 at 7:20 AM

The Zipper

Given three strings, you are to determine whether the third string can be formed by combining the characters in the first two strings. the first two strings can be mixed arbitrarily, but the characters from each must stay in their original order in the third string.

For example, consider forming "tcraete" from "cat" and "tree":

String A: c a t
String B: t r e e
String C: t c r a e t e

As you can see, we can form string C by alternately selecting characters from strings A and B, starting with string B. As a second example, consider forming " catrtee" from "cat" and "tree";

String A: c a t
String B: t r e e
String C: t c r a e t e

Finally, notice that it is impossible to form "cttaree" from "cat" and "tree".

INPUT
There will be multiple cases to consider. For each case the input consists of three lines, each containing a string, with the string possibly preceded and followed by one or more whitespace characters (blanks and tabs). Each string contains only upper and lower case letters. The length of the third string is always the sum of the lengths of the first two strings. The first two strings will have lengths between 1 and 200 characters, inclusive. The case is followed by a single line that contains a period in the first column.

Output
For each case display a line containing the case number (starting with 1 and increasing sequentially), and the word "yes" or "no" to indicate whether the first two strings can be "zippered" to produce the third string. The output format is illustrated in the sample shown below.

Sample Input Output for the sample input

cat Case 1: yes
tree Case 2: yes
tcraete Case 3: no
cat
tree
catrtee
cat
tree
cttaree

Please help me code this problem thank you


View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

i need a quick response about array and string...
i need a quick response about array and string...  how can i make a dictionary type using array code in java where i will type the word then the meaning will appear..please help me..urgent 

Java Beginners

programing
Hello if anyone can help I would like to know why I get this error when executing...programing  Using Java, Design a simple interface that can capture information of your choice with the following controls; Labels, Text Fields 

Java Beginners

guys,, need help,, in java programing,, arrays
guys,, need help,, in java programing,, arrays  create a program where you will input 10 numbers and arrange it in ascending way using arrays 

Java Beginners

Java programing
Java programing   need help wrting this Write a program that has an array of 5 Strings, and determines which ones are palindromes (letter-case does not matter). thanks 

Java Beginners

Programing Help - Java Beginners
Programing Help  how to design a filebrowser in java "witout using Swing 

Java Beginners

Please help need quick!!! Thanks
Please help need quick!!! Thanks  hey i keep getting stupid compile...]; for(int i = 0; i < team.length; i++){ team[i...(); array[4] = orangeboat.getSum(); for(int i = 1; i < array.length ; i 

Java Beginners

java programing - Java Beginners
;> I need your help about this...   Hi Medinz, Here is my...java programing  Write a program that reads numbers fromthe keyboard...: "); Scanner scan = new Scanner(System.in); for (int i = 0; i < a.length; i 

Java Beginners

help with substring in c programing
help with substring in c programing  Hi I could not found programming in C in the "select category" so I am posting my question in java section. Please help with substring function,prompt the user for two strings and display 

Java Beginners

hello there i need help
i am a beginner, and aside from that i am really eager to learn java please help me with the codes and please explain to me how it works. i only need to use...hello there i need help  : i need to do a program like 

Java Beginners

programing question
programing question  how do i use loops(for,while) to add components in java   Hi Friend, The below code might help you. import java.awt.... panel=new JPanel(new GridLayout(5,2)); for(int i=0;i<5;i++){ int j=i+1 

Java Beginners

Java programing help
Java programing help  Can you help me create this program? Write a console program that repeatedly prompts the user to enter data until they type done (any case, Upper, Lower, or Mixed). As they enter the data, assign 

Java Beginners

SOCKET PROGRAMING IN THE JAVA FOR NETWORKING CONCEPT
SOCKET PROGRAMING IN THE JAVA FOR NETWORKING CONCEPT  I WANT TO KNOW ABOUT THE JAVA SOCKET PROGRAMING FROM BASIC LEVEL AND HOW CAN I WORK ON IT I KNOW THE JAVA PROGRAMING.SO PLEASE HELP ME HOW CAN I DO SOCKET PROGRAMING 

IoC Questions

programing - IoC
and largest integer  Hi friend, Code to help in solving the problem...); // read in user input int ar[] = new int[4]; int count=1; for(int i=0;imax) { max = ar[i]; } } System.out.println("Min " + min 

WebSevices Questions

programing - WebSevices
put  Hi friend, Code to help in solving the problem : import... count=1; for(int i=0;imax) { max = ar[i...); } } For read more information,Examples and Tutorials on Java visit 

Java Beginners

Waiting for ur quick response
Waiting for ur quick response  Hi, I have two different java... to run it java A The output is: Hai This part is completed. Now i ll go... have to run it java A Now the output is: Hello Now i want to get 

Java Beginners

java programing - Java Beginners
java programing  hi!! I Wish i am welcome in this site. As You can see i am trying to teach my self how to program using java language and manually is by not using the function in java language. please help me    

Java Beginners

beginning java programing
beginning java programing  Hi. I am trying to write a piece of code that not allow a duplicate item to be added to the list (and allow for either... help me. public void findAndAddFlavor() { //Retrieve the new flavor 

Java Beginners

I need your help - Java Beginners
I need your help  What is the purpose of garbage collection in Java, and when is it used?  Hi check out this url : http://www.artima.com/insidejvm/ed2/gc.html http://java.sun.com/javase/technologies/hotspot 

Java Interview Questions

i need your help - Java Interview Questions
i need your help  Write a java program that: i. Allows user to enter 2 numbers from the keyboard ii. Uses a method to compare the two numbers to determine which is larger iii. Print to the screen stating which number is larger 

Java Beginners

Java Programing
Java Programing  I)WAP to print following series: 1) 1... Number: "); int i = input.nextInt(); String bi = Integer.toBinaryString(i); System.out.println("Binary of "+i 

Java Beginners

need help pleaseee....i weak in java
need help pleaseee....i weak in java  QUESTION 1 You are required... meter reading, current meter reading and charges. Write a structured Java program...) Separate them as either R/r for Residential or I/i for Industrial. You can use 

JSP Servlet Questions

Need help on JAVA JSP
Need help on JAVA JSP  Hi, I have never worked on java and I have been given an assignment where I have to fix existing issues in the tool(created...(need to know how I can adjust it based on the cureen system's screen resolution 

Java Beginners

I need help in doing this. - Java Beginners
I need help in doing this.  Student DataBase i will need creating..., and the student's GPA.using arrays and objects, need to structure the information... objects that will house the birthdates for each student member. (I have 

Java Beginners

I need your help - Java Beginners
I need your help  For this one I need to create delivery class for a delivery service .however, this class should contain (delivery number which... the file name is ApplicationDelivery.java Your program must follow proper Java 

Java Beginners

Need Help - Java Beginners
Need Help  Hello Sir, Am a beginner of Java. Also i did course on J2EE... but dont have any ideas about real time projects. But i want to do some projects in Java as well as J2EE... Can u help me and guide to do a project 

Java Beginners

need help - Java Beginners
need help  Need help in programming in Java  Simple java...();DISPLAYING OUPUT " * " ," *** " ........I used System.out.print('"'); statement before System.out.print("*"); statement and I used 

Java Beginners

Need help - Java Beginners
Need help   To Write a Java program that asks the users to enter a m...; Hi Friend, Please try the following code. We hope that this code will help...[]) { int[][] arr = new int[4][4]; for (int i = 0; i

Java Beginners

Need help in java programming
Need help in java programming  Hello. Can someone please help me... 10% Exam 60% Java program that accepts the following details: student... StudentResult[2]; for (int i=0; i<data.length; i++) { int j=i+1 

Java Interview Questions

i need latest oracle certified java dumps.. Pleas help me?
i need latest oracle certified java dumps.. Pleas help me?  i need latest oracle certified java dumps.. Pleas help me 

Java Beginners

need help with a program - Java Beginners
need help with a program   Part I An algorithm describes how... by the user. The output of the program should be the length and width (entered.... First you would need to make up the "test data". For this algorithm, the test data 

Java Beginners

Java Programing - Java Beginners
Java Programing  I used setMnemonic method to put shortcut key... this one. I am using system look and feel  Hi friend, import...); } } --------------------------------------------------- Visit for more information. http://www.roseindia.net/java 

General

Tomcat Quick Start Guide
Tomcat Quick Start Guide       This tutorial is a quick reference of starting development application using JSP, Servlets and JDBC technologies. In this quick and very 

Java Beginners

( Inheritance, Polymorphism, Overriding)i need help - Java Beginners
( Inheritance, Polymorphism, Overriding)i need help  Advanced Concepts with Classes( Inheritance, Polymorphism, Overriding) i need help to create this application,than you Employees in a company are divided into the classes 

Java Beginners

Need *Help fixing this - Java Beginners
Need *Help fixing this  I need to make this program prompt user... and maybe add retrieve function //need help with this one badly. Thanks guys for all...(); c.setLayout( new FlowLayout()); //help: how do I set layout properly c.add 

Blog

Struts Quick Start
Struts Quick Start Struts Quick Start to Struts technology In this post I will show you how you can quick start the development of you struts based project... applications in Java technology. Struts is one of the most used framework 

Java Tips and Examples

Quick Sort In Java
Quick Sort in Java      ...;java QuickSort RoseIndia Quick Sort... to sort integer values of an array using quick sort. Quick sort algorithm 

Java Beginners

Need Help in Java programming
Need Help in Java programming  Hello. Can someone please help me with writing the following program Java program that gives assignment details such as:assignment number,assignment name,due date,submission date,percentage marks 

Java Beginners

I need add my java program with a picture.
I need add my java program with a picture.  Good evng Frnds Friends i created 1 jar file in my desktop. I need add this program with 1 picture... of opening Picture. I think most of the softwares are like that . They are first 

Java Beginners

java programing
java programing  reverse a multidigit number using recursive definition 

Java Interview Questions

java programing
java programing  write a program to input a number or find & print the highest digit 

Java Tips and Examples

Quick Sort in Java
Quick sort in Java is used to sort integer values of an array... into a sorted array. Example of Quick Sort in Java: public class QuickSort... QuickSort.java C:\array\sorting>java QuickSort RoseIndia Quick Sort 

Java Interview Questions

java programing
java programing  write a program to input a number or find & print the highest digit. example:-2639 than print 9 

Java Beginners

need help on writing a program. - Java Beginners
Writing first Java Program  Hi, I need help to write my first Java... roseIndia to get your query solved. check given link to see the solution of your Java problem.http://www.roseindia.net/java/simple-java-program.shtmlThanks 

Java Beginners

This is what i need in this Question - Java Beginners
array. so i need your help to know is it correct or wrong Thank you...This is what i need in this Question  You are to choose between two... explaination with out coding In my understanding I choose the non-empty array 

Java Interview Questions

java programing
java programing  Integers from 0 to X stored in an array of size X+1. Each integer appears once & only once, but in random order e.g. Consider array of size 5 as below... Arr[0]=3; Arr[1]=0; Arr[2]=1; Arr[3]=4; Arr[4]=2 

Java Beginners

help
help  i need help with this code. write a java code for a method named addSevenToKthElement that takes an integer array, and an integer k as its arguments and returns the kth element plus 7. any help would be greatly 

Java Beginners

I need help on my Java code.... please please help me out!?
I need help on my Java code.... please please help me out!?  Well my... the anagram on screen or the output file! Please show me whats wrong. Thanks i need a part of the code thats fixed if possible! Heres is the code: import 

Java Beginners

need help with a program - Java Beginners
Java algorithm - need help with a program  Java algorithm - need help with a program 

Java Beginners

need help. - Java Beginners
 

Java Beginners

Need help in constructing bubble sort
Need help in constructing bubble sort  using a bubble sort, for each... by : (colon) sorted by the second dimension. I already got the two dimensional...://www.roseindia.net/java/beginners/arrayexamples/bubblesort.shtml http://www.roseindia.net/java 

Swing AWT

Need Help with Java-SWING progrmming - Swing AWT
Need Help with Java-SWING progrmming  Hi sir, I am a beginner in java-swing programming. I want to know how we can use the print option with a program in swing. Could you help me with an example? Regards Sreejith  

Java Beginners

need help with java program as soon as possible
need help with java program as soon as possible  So my assignment...("Numbers and their squares between 1 and 10"); int i=1; while(i <= 10) { System.out.println(i+" "+(i*i)); i++; } System.out.println("Sum Of square of odd 

Swing AWT

Need Help To Connect XML as backend in Java-Swing
Need Help To Connect XML as backend in Java-Swing  Seat arrangment swing screenshot I made XML program to connect to swing like this. <?xml... problem is if i click the B1 label it need to change as(occupied-grey colour 

Java Beginners

Need help writing a console program
Need help writing a console program  I need help cant seems to figure...): This is a test, this is only a test! This test is a test of your Java programming... is what i got so far. import java.io.File; import java.util.Scanner; public class 

Java Beginners

need help creating a lift program - Java Beginners
need help creating a lift program  Classes, Methods, Constructors please i need help to create an elevator program Simulating an Elevator write... for any help rendered 

JavaMail Questions

i need a help in this please
i need a help in this please  The factorial of a nonnegative integer n is written n! (pronounced ‚?? n factorial‚??) and is defined as follows: n!=n...=input.nextInt(); long num=m; for(int i=m;i>1;i 

Java Beginners

I have need to help
I have need to help  Write a program that, for four points A, B, C and P, draws a triangle formed by ABC and a small cross showing the position of P; and displays a line of text indicating which of the following three cases 

JDBC Questions

I really need help with this assignment question Please help me out Please
I really need help with this assignment question Please help me out Please ... a Java application to provide these services by connecting to a database hosted... in MySQL. For this purpose you will need to use the sheridancollege database we 

Java Beginners

This is what i need - Java Beginners
. for this question i need just : one function can read string like (I like...This is what i need  Implement a standalone procedure to read in a file containing words and white space and produce a compressed version of the file 

Java Beginners

Java Programming Need Help ASAP
Java Programming Need Help ASAP  You are required to develop..., maths mark, communications mark. You will then need accessor and mutator methods... class that creates an array of Students and handles it. You will need 

Java Beginners

java help!
java help!   I need help starting off a program I am trying to write for class. The class should contain a private instance variable to represent... celsius.There are more methods but I would prefer to try them myself! Can someone please 

Java Beginners

PLZ Need some help JAVA...HELP !!
PLZ Need some help JAVA...HELP !!  Create a class names Purchase Each purchase contains an invoice number, amount of sale and amount of sales tax. Include set methods for the invoice number and sale amount. Within the set 

Java Beginners

java programing - Java Beginners
java programing  What is java program coading to convert a mp3 file to it binary equivalent 

Java Beginners

java programing problem - Java Beginners
java programing problem  Create a class named Movie that can be used with your video rental business. The Movie class should track the Motion picture Association of America rating , ID Number, and movie title with appropriate 

Java Beginners

java programing - Java Beginners
java programing  How to Design and create a java class for address book object that contains a person's name, home address and phone number..., and pager. Write a java GUI application to add, edit,delete and find the address 

Java Beginners

seriously need help....
seriously need help....  Write a program that will prompt the user to select an appliance, lookup the energy the appliance uses and for each time... program. Use each of the following Java statements at least once in your program 

Java Beginners

java program...need help as soon as possible!!! - Java Beginners
java program...need help as soon as possible!!!  Modify the Lexer (15.... 4. Print each token with line number READLINE: program { int i int j... left: 10 right: 12 line: 1 i left: 14 right: 14 line: 1 int left 

Hibernate Interview Questions

what is java and why do i need it?
what is java and why do i need it?  Hi, Please tell me what is Java and why do i need it? Is it free to download? Also explain me how to write and test my first Java Application? What is the configuration or system requirement 

Java Beginners

Need help in completing a complex program; Thanks a lot for your help
Need help in completing a complex program; Thanks a lot for your help ... stuck: I need to write a batch file (Windows) which will pass that string... no output. So please help me with this too. And also, I am using Runtime function 

Java Beginners

i need a java code for finding typemismatch in an editor.
i need a java code for finding typemismatch in an editor.  hi im sriram, i need a java code in such a way that typemismatch code is embedded with the simple java editor. the sample output is shown below !alt text 

Development process Questions

i need help - Development process
i need help  hello, i need help regarding this program. this program... IPAddress on command line, but i want to take it dynamically and it must store...?   hi subhash hope this code can help you, public class PingTest 

Development process Questions

i need help - Development process
i need help  hello, i need help regarding this program. public...()); } } } it is printing the result of ping in to a file,but if i want... the result in to the files,if i want to do this i must make my program running 

JavaScript Questions

i need help to solve this problem
i need help to solve this problem  Write a stack class ArrayStack.java implements PureStack interface that reads in strings from standard input.... H and I join the queue h. G leaves the queue i. H and I leave the queue 

Java Beginners

i need help plz .... Quickly
i need help plz .... Quickly   how can i count how many numbers enterd by the user so the output would be like this Total number of Scores = .... this is my code :- import java.util.Scanner; public class SCORES { public 

Java Beginners

java IO programing
java IO programing  how Java source file is used as input the program will echo lines 

Java Beginners

Need help
Need help  Hello... I need some help I have a method which contains 1 string value and i wnat when this method get called den that string value should b assigned as array name.. for example.. i have a method name() which 

Java Beginners

Need help
Need help  Hello... I need some help I have a method which contains 1 string value and i wnat when this method get called den that string value should b assigned as array name.. for example.. i have a method name() which 

Development process Questions

Java programing - Development process
Java programing  1.What is system.out and system.in? 2.write down the steps to run Java application 3.what are the function of the following methods a.show input dialogue message. b.show output dialogue message 

Development process Questions

help
help   how i can send a pitcture on url in java 

Java Beginners

code need - Java Beginners
code need  hi i want to code doing for this. If i have enter the text file in my java project. example input is 1,2,3,4,5(it is in input text file...)  Hi Friend, Try the following code. We hope this will help you 

Java Interview Questions

Need help
Need help  Dear sir, I have a problem. How to write JSP coding, if a user select a value from drop down list for example department, the another drop.... This name list should get from the database. Please help me. By the way, I'm 

JDBC Questions

java programing - JDBC
java programing  A retail company has got the records of its customers which contains name, home address and phone number, business address and phone number, and numbers for their fax machine, cellular phone, and pager, marital 

Java Beginners

Need help with this!
Need help with this!  Can anyone please help me... to effectivly end the loop with out the need to break it. for(i=(0); i <... to a file at all at this time. Any help would be greatly appreciated, thank you 

Java Beginners

really need help on how to write this program plz some 1 help out. - Java Beginners
really need help on how to write this program plz some 1 help out.  i am confused here on what to write can some 1 help out here i dont quite understand how to code it so can some 1 help out. Part II Write, compile and execute 

Java Beginners

java help - Java Beginners
java help  Code a try statement that catches an IOException and an EOFException. If an IOException occurs, print the message ?An I/O error occurred....? to the console. You don?t need to code anything within the try block 

Java Beginners

Sales System.. Need Help!! - Java Beginners
Sales System.. Need Help!!  were going to make a sales system in our... help us.. Thank you very much for your reply in my past questions you are a big help.. Thank you so much. Hope you will help me again thanks!! God Bless and more 

Java Beginners

Java Question Anyone need some HELP !!
Java Question Anyone need some HELP !!  Create a file that contains... of the two files. Note: For the above code, you need POI api. import... and poi-scratchpad-3.2-FINAL-20081019.jar files into the following path: \Java 

Java Beginners

need java code - Java Beginners
need java code  i want a program for an algorithm in java which is it has some transactions T1=ABCE T2=CDE T3=DE T4=CDEG T5=BG T6... result . For this algorithm i need a program can any help me 

WebSevices Questions

help
help  Hii.. I have to design one registration page in java that looks like REGISTER USERNAME (here i have to check whether username already exists... to the user) please tell me how could i design that. Please help me asap Thanks a lot 

Java Beginners

Regular Expression Help Help HELP!!!!
Regular Expression Help Help HELP!!!!  HI all I am very new to java... = "International Students 1"; So i need to extract only the "international Students", i...","hotmail.com"); so i need to extract"07001", "MR Harish Ram " and extract "M.RHarish 

Java Beginners

Java help - Java Beginners
Java help  I need to write an application that uses the circle class. It must read a radius of a circle from the user creates a circle object, and return the object. The program creates a circle object by using the above method 

JSP Servlet Questions

need
need  i need a jsp coding based project plz help me 

Java Beginners

( Inheritance,need help in Polymorphism, Overriding) - Java Beginners
( Inheritance,need help in Polymorphism, Overriding)  can any one please help me create this application,thank you Advanced Concepts with Classes( Inheritance, Polymorphism, Overriding) Employees in a company are divided 

JavaScript Questions

help
;/h3> <script> var n=window.prompt("Enter the value of n: "); var i=1; var sq; for(i=1;i<=n;i++){ sq=i*i; document.write(i+": "+sq+"<br>... this in java then try this: import java.util.*; class SquareNumber { public 

Java Beginners

help
help  how can i query for a minimum value of of one of the column in my database through java   Use min to retrieve the minimum value from one column of database table. Suppose you have a table named emp where 

JSP Servlet Questions

Help
Help  <%@ page language="java" contentType="text/html; charset... = document.getElementsByTagName('input'); var formValid = false; var i=0; while(!formValid && i " id="radio2" name="radio"/> " id="radio3" name="radio"/> 

Java-Tutorials

Quick Sort in Java
Quick Sort in Java Quick Sort in Java is used to sort elements of an array. Quick sort works on divide and conquer strategy and comparison sort... in Java works? Quick Sort algorithm works on comparison sort that means 

Java Beginners

help
Java application  public int remainder(int a, int b... = calc.remainder (3,4); System.out.println (answerRemain); and when i tried...) if i take out the % from "%d % %d = ", so that it is "%d %d" then it runs 

Java Beginners

New to Java Please help
New to Java Please help  Hi I need help, can some one help me with this. I am currently doing a project. drop me an email to my email address. Thanks!   If you are new in java, then you need to learn core java 

Java Interview Questions

help
other for me before Tuseday I answer the first part please continue to me...(); } } SFDV2103 ‚?? Java Programming Fall, 2012 Term Project... on the percentage of cheating. SFDV2103 ‚?? Java Programming Fall, 2012 Term 

Advertisements Advertisements
 

 

 

DMCA.com