文章
279. Perfect Squares
Givenapositiveintegern,findtheleastnumberofperfectsquarenumbers(forexample,1,4,9,16,...)whichsumton.Example1:<pre<codeI
322. Coin Change
Youaregivencoinsofdifferentdenominationsandatotalamountofmoneyamount.Writeafunctiontocomputethefewestnumberofcoinsthatyounee
异或巧用,一道令我汗颜的算法题——减小时间空间复杂度
写在前面咱不是计算机专业的,却一直对计算机算法感兴趣,也一直致力于减小自己程序的复杂度捂脸,昨日吃饭时,某老铁考我一道算法题,思索良久,辗转反侧,夜不能寐,遂厚着脸皮去问答案,然则令吾汗颜,果真是一波骚操作……看题!<blockquote给定一个
318. Maximum Product of Word Lengths
Givenastringarraywords,findthemaximumvalueoflength(wordi)length(wordj)wherethetwowordsdonotsharecommonletters.Youmayassum
313. Super Ugly Number
Writeaprogramtofindthenthsuperuglynumber.Superuglynumbersarepositivenumberswhoseallprimefactorsareinthegivenprimelistprimeso
1003-检查替换后的词是否有效
前言WeeklyContest126(https://link.segmentfault.com/?encnxjzFpVJ20N2gpi0AVOpOw%3D%3D.mKvkwJrA6YZo%2BBNvV5K%2F2w7U5bwF7Pbm62lcJ36EoTQdY0MQlXZzu
1002-查找常用字符
前言WeeklyContest126(https://link.segmentfault.com/?encaA7P3ND0H9x8d8AMBg47sQ%3D%3D.KZHSeJZ%2Fh9venKEDPWICO5sySUXreaY8tut6ntlHbNTK5rbP5qoFFmT
LeetCode 328. Odd Even Linked List
DescriptionGivenasinglylinkedlist,groupalloddnodestogetherfollowedbytheevennodes.Pleasenoteherewearetalkingaboutthenoden
binary search总结(1)
模版:左闭右开lo,hi)伪码如下:<pre<codedefbinarySearch(lo,hi){while(lo<hi){intmid(hilo)/2lo;if(f(m))returnm//
LeetCode刷题——29. Divide Two Integers(Part 2靠大家)
上篇文章写了以我自己的思路来解决这个问题,但是运行时间过长,看了leetcode上的高效写法是使用位运算的解法,当初我自己写这个问题是也想到了可以用位运算快一点,但是因为基础差,对位运算的掌握不牢靠,还是选择使用了减法的思路,在此将leetcode上高效解法做一个思路分析,加深下自己对位运算的理解
已加载文章中没有匹配内容,试试其他关键词或清空搜索。