算法
木木山水日月
用代码做你想做的事
展开
-
特定字符统计的两种算法
原问题:You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of t...原创 2018-10-17 21:11:10 · 360 阅读 · 0 评论 -
m选n组合的两种算法(C语言实现)
原问题: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. 1. 递归算法即首先选择n,然后递归地从剩下的1...n-1选择k-1个数,然后选择n-1,然后递归地从剩下的1...n-2选择k-1个数,直到选到k。//d存储选择的数,NUM指示选择多...原创 2018-10-17 21:23:02 · 10257 阅读 · 0 评论