Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use java to realize the letter combination of telephone number

Shulou Source: shulou.com Published: 2022-06-01 01:01:08 10月02日 Update

This "how to use java to achieve the phone number letter combination" article, the article sample code is very detailed, with a certain reference value, interested friends must refer to, for "how to use java to achieve the phone number letter combination", Xiaobian sorted out the following knowledge points, please follow the pace of the editor step by step slowly understand, then let us enter the topic.

Given a string that contains only the numbers 2-9, returns all the combinations of letters it can represent.

The number-to-letter mapping is given as follows (same as the phone button). Note that 1 does not correspond to any letters.

Example:

Enter: "23"

Output: [ad "," ae "," af "," bd "," be "," bf "," cd "," ce "," cf ".

Description:

Although the answers above are in dictionary order, you can choose the order in which the answers are output.

Parsing:

This is very similar to the previous question, but the principle is the same, sorting first, and then a for loop and while loop to find the so-called value, if you can find a direct return, otherwise return the one with the smallest difference.

What are the collection classes in Java? the sets in Java are mainly divided into four categories: 1, List list: ordered, repeatable; 2, Queue queue: ordered, repeatable; 3, Set collection: non-repeatable; 4, Map mapping: disorder, key unique, value is not unique.

The above is all the contents of the article "how to use java to realize the letter combination of phone numbers". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Letters phones combinations numbers phone numbers order content numbers knowledge examples answers references loops output minimum similar same next subject code Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology Apple OPPO Reno MariaDB