![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 71
lxx-sissi
小菜鸟一个
展开
-
一些算法的通用框架(持续更新)
回溯法是一种选优搜索法,又称为试探法,按选优条件向前搜索,以达到目标。但当探索到某一步时,发现原先选择并不优或达不到目标,就退回一步重新选择,这种走不通就退回再走的技术为回溯法,而满足回溯条件的某个状态的点称为 “回溯点”。可以把回溯法看成是递归调用的一种特殊形式。原创 2022-10-08 17:32:36 · 831 阅读 · 0 评论 -
codewars,js实现4kyu:Default Arguments
目录题目简介Example最终代码解题思路难点题目简介该kata的链接地址Write a function defaultArguments. It takes a function as an argument, along with an object containing default values for that function’s arguments, and returns another function which defaults to the right values.Yo原创 2020-06-20 17:04:59 · 314 阅读 · 0 评论 -
codewars,js实现5kyu:Write out numbers(数字转化为英文写法)
目录题目简介Example我完成的代码我的解题思路我的难点题目简介该kata的链接地址Create a function that transforms any positive number to a string representing the number in words. The function should work for all numbers between 0 and 999999.Exampleumber2words(0) ==> "zero"number2w原创 2020-05-27 22:27:58 · 382 阅读 · 0 评论 -
codewars:js实现5kyu:A Chain adding function
目录题目描述Example我完成的代码我的思路我的难点题目描述该kata的链接: link.We want to create a function that will add numbers together when called in succession.add(1)(2);// returns 3We also want to be able to continue to add numbers to our chain.add(1)(2)(3); // 6add(1)(2)(3原创 2020-05-23 12:01:44 · 484 阅读 · 0 评论 -
codewars,js实现4kyu:Number of Proper Fractions with Denominator d
目录题目描述Example代码实现我第一次完成的代码(由于代码时间复杂度太高,编译超时了,未通过)欧拉函数(有点理不清,需要多研究扩展一下)按照欧拉函数的公示完成的代码思路难点题目描述该kata的链接地址: link.If n is the numerator and d the denominator of a fraction, that fraction is defined a (reduced) proper fraction if and only if GCD(n,d)==1.For原创 2020-05-21 16:58:09 · 213 阅读 · 0 评论 -
codewars,js实现5kyu:ntegers: Recreation One
目录题目描述Example代码实现我完成代码解题思路难点题目描述该kata的链接地址: link.Divisors of 42 are : 1, 2, 3, 6, 7, 14, 21, 42. These divisors squared are: 1, 4, 9, 36, 49, 196, 441, 1764. The sum of the squared divisors is 2500 which is 50 * 50, a square!Given two integers m, n (1原创 2020-05-20 20:40:49 · 175 阅读 · 0 评论 -
codewars , js实现4kyu:recover a secret string from random triplets
目录题目描述Example代码实现我完成代码解题思路难点题目描述该kata的链接地址: link.Given a positive number n > 1 find the prime factor decomposition of n. The result will be a string with the following form :“(p1n1)(p2n2)…(pk**nk)”with the p(i) in increasing order and n(i) empty if原创 2020-05-20 20:34:49 · 376 阅读 · 0 评论 -
codewars , js实现5kyu:Primes in numbers
目录题目描述Example代码实现我完成代码解题思路难点题目描述该kata的链接地址: link.Given a positive number n > 1 find the prime factor decomposition of n. The result will be a string with the following form :“(p1n1)(p2n2)…(pk**nk)”with the p(i) in increasing order and n(i) empty if原创 2020-05-20 20:23:47 · 176 阅读 · 0 评论 -
codewars , js实现4kyu:Range Extraction
这里写目录标题题目描述Example代码实现我完成的代码解题步骤难点题目描述该kata的链接地址: link.A format for expressing an ordered list of integers is to use a comma separated list of eitherindividual integersor a range of integers denoted by the starting integer separated from the end i原创 2020-05-19 17:10:15 · 307 阅读 · 0 评论 -
codewars , js实现4kyu:Strings Mix
目录题目描述代码实现我完成的代码解题步骤(表达能力不是太好......)难点题目描述该kata的链接地址: link.Given two strings s1 and s2, we want to visualize how different the two strings are. We will only take into account the lowercase letters (a to z). First let us count the frequency of each lower原创 2020-05-16 16:21:33 · 412 阅读 · 0 评论 -
codewars , js实现4kyu:Square into Squares. Protect trees!
这里写自定义目录标题4kyu:Square into Squares. Protect trees!TaskExamplesNoteNote for BashHintjs代码实现4kyu:Square into Squares. Protect trees!My little sister came back home from school with the following task: given a squared sheet of paper she has to cut it in piec原创 2020-05-14 10:17:22 · 430 阅读 · 0 评论