816 Ambiguous Coordinates (many cases problem)

https://www.cnblogs.com/Java3y/p/8846955.html -- link of the problem 816

IDEA: check the dot and integer cases. -- seperate the string into two parts, and make all  the ombination case for each one, then checking they are valid or not finally by virtue of two loops, creat the right combination.

Difficulty: medium: hard to cover al the cases.  (1:30 to solve) long time to solve it.

Bad idea: for each case: check if meet the requiremtn and then add them to list(), make many cases by myself.

The problem looks like a simulation problem instead of a combination problem.

Java: I using set<String> set = new TreeSet<>() to avoid the duplicate cases.

 

posted @ 2018-04-15 13:02  wz30  阅读(108)  评论(0编辑  收藏  举报