码迷,mamicode.com
首页 >  
搜索关键字:leetcode easy    ( 39612个结果
212. Word Search II
package LeetCode_212 /** * 212. Word Search II * https://leetcode.com/problems/word-search-ii/ * Given an m x n board of characters and a list of stri ...
分类:其他好文   时间:2021-01-05 11:21:11    阅读次数:0
【leetcode】306. 累加数
bool isAdditiveNumber(char * num){ int i, j, k, len=strlen(num), pst1=0, pst2=0, bit=0, third; char* tmp1=(char*)calloc(22,sizeof(char)); char* tmp2=( ...
分类:其他好文   时间:2021-01-05 11:20:52    阅读次数:0
leetcode刷题
1. 两数之和 思路: 1、创建一个map 集合 2、for循环遍历nums 数组 3、用target 减去nums[i],以计算哪个数能和当前的数相加得到target 4、检查map 里面有没有这个数,如果有则返回结果,没有就把num[i]当做key、下标i 当做value放入map中(为什么?) ...
分类:其他好文   时间:2021-01-05 11:20:01    阅读次数:0
算法——模拟小数除法
给定两个整数,分别表示分数的分子 numerator 和分母 denominator,以 字符串形式返回小数 。 如果小数部分为循环小数,则将循环的部分括在括号内。 如果存在多个答案,只需返回 任意一个 。 对于所有给定的输入,保证 答案字符串的长度小于 104 。 leetcode 解题思路:这里 ...
分类:编程语言   时间:2021-01-05 10:58:24    阅读次数:0
新年第一道Leetcode题:605.种花问题(can-place-flowers)
思路:防御式编程,在收尾都加1个0,这样方便循环 bool canPlaceFlowers(vector<int> &flowerbed, int n) { if (n == 0) return true; if (flowerbed.size() == 0) return false; flowe ...
分类:其他好文   时间:2021-01-05 10:57:55    阅读次数:0
LeetCode 077. 组合 dfs
地址 https://leetcode-cn.com/problems/combinations/ 给定两个整数 n 和 k,返回 1 ... n 中所有可能的 k 个数的组合。 示例: 输入: n = 4, k = 2 输出: [ [2,4], [3,4], [2,3], [1,2], [1,3] ...
分类:其他好文   时间:2021-01-05 10:38:45    阅读次数:0
【leetcode】299. 猜数字游戏
char * getHint(char * secret, char * guess){ int shash[10]={0}; int ghash[1000]={0}; int i, len=strlen(secret), A=0, B=0, l=0; char* s=(char*)calloc(1 ...
分类:其他好文   时间:2021-01-05 10:37:37    阅读次数:0
Spring Boot 实战系列:01 Hello, World
概述 Overview 什么是Spring Boot? Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run". 这是来自S ...
分类:编程语言   时间:2021-01-04 10:29:55    阅读次数:0
带条件的递归2,二叉树求和
一.描述 通过二叉树带条件的求和来更好的理解递归 可以参考前两篇文章 一个简单的二叉树的例子来理解递归 二叉树和BST的递归,带条件 二.左叶子求和 来源:https://leetcode-cn.com/problems/sum-of-left-leaves/ 题意为求左叶子节点的值的和 之前文章提 ...
分类:其他好文   时间:2021-01-02 11:46:41    阅读次数:0
回溯算法:电话号码的字母组合
给「代码随想录」一个星标吧!?多个集合来求组合,还是有点不一样!通知:我已经将公众号文章和学习相关的资料整理到了Github:https://github.com/youngyangyang04/leetcode-master,方便大家在电脑上学习,可以fork到自己仓库,顺便也给个star支持一波吧!?17.电话号码的字母组合给定一个仅包含数字2-9的字符串,返回所有它能表示的字母组合。给出数字
分类:编程语言   时间:2021-01-02 11:01:14    阅读次数:0
39612条   上一页 1 ... 47 48 49 50 51 ... 3962 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!