摘要: 问题: 给定一个非负整数,求只交换一次某两位的数字,使得值最大,求该最大值。 Example 1: Input: 2736 Output: 7236 Explanation: Swap the number 2 and the number 7. Example 2: Input: 9973 Out 阅读全文
posted @ 2020-04-21 14:24 habibah_chang 阅读(107) 评论(0) 推荐(0)
摘要: 问题: 给定StartWord和EndWord,在给定的dict中寻找每次值变换一个字母,最终从StartWord能够推移到EndWord的所有最短序列。 Example 1: Input: beginWord = "hit", endWord = "cog", wordList = ["hot", 阅读全文
posted @ 2020-04-21 13:11 habibah_chang 阅读(167) 评论(0) 推荐(0)