leetcod日志
惊鸿化飞雪
河姆渡小码农
展开
-
279. Perfect Squares(最少完全平方数)C++描述
0. 题目描述 Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n. 给定一个正整数n,找出最少个完全平方数,它们的和为n,返回个数 [点击此处跳转题目原地址](https://leetcode.com/...原创 2018-08-31 15:56:11 · 1292 阅读 · 0 评论 -
127.Word Ladder (C++实现)
0.题目描述 Given two words (beginWord and endWord), and a dictionary’s word list, find the length of shortest transformation sequence from beginWord to endWord, such that: Only one letter can be changed...原创 2018-08-31 22:06:06 · 1102 阅读 · 0 评论 -
126. Word Ladder II(C++实现)
0. 题目描述 此题延续127Word Ladder I ,区别在于,127只需要返回最短路径的步数,而本题目需要返回所有最短路径的路径信息。本文给出两种采用广度优先遍历的方法。 示例1: Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log",&原创 2018-09-04 14:33:24 · 977 阅读 · 0 评论