Menu
Question Index
...


Write a program to check if the word can be formed with letters of the other word. Can not use the letter more number of times than it is present in the original.

Input (String, String) Output (boolean)
potato, pot true
potato, tattoo false
potato, too true
India, Idea false
India, dandia false

class CanWordBeFormedWithLettersUsingOnlyOnce

{    public static void main(String s[])
    {
        String originalWord = "potato";
        System.out.println("The word 'tattoo' is present : " + canFormWord(originalWord, "tattoo"));

    }


public static boolean canFormWord(String originalWord, String formedWord) {
//Write code here to identify if the word can be formed with letters of the other word. Can not use the letter more number of times than it is present in the original word.
}
}

Doubts

Problems

Topic: Java Searching Strings - Java indexOf, lastIndexOf Methods

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App