Xiaoliji's Blog

小里脊的个人博客


  • Home

  • Categories

  • Tags

  • Archives

  • About

  • Search

算法篇目录汇总

Posted on 2019-02-15   |   Updated on 2021-01-23 | In 算法 | | Visitors

前言

从去年9开始刷算法题,截止到今天,陆续用了大概半年的时间,已经完成《剑指Offer》中的题目,LeetCode中Easy难度的题型也已经基本完成了。由于相关算法博客日益增多,所以建立此目录方便快速查找。另外有一些题型在初期分类不是很合适,所以在完成Easy题之后对所有种类了解的情况下,重新修改一些题的分类。

Read more »

Google kickstart Round H 2020

Posted on 2020-11-15   |   Updated on 2020-11-17 | In 算法 | | Visitors
尴尬,比赛看错了时间,把结束时间当成了开始时间了。
Read more »

Google kickstart Round A 2020

Posted on 2020-10-21   |   Updated on 2020-11-05 | In 算法 | | Visitors
经过了上次G轮的比赛,发现kickstart很好,题目质量也很高,大数据的测试用例能够帮助我发现一些效率上的问题。所以打算将2020年过往轮次补一下。
Read more »

Google kickstart Round G 2020

Posted on 2020-10-19   |   Updated on 2020-10-20 | In 算法 | | Visitors
首次参加Google kick start的线上比赛,获得了1337/6700(提交了答案的选手)的成绩,提升空间还是比较大。第3题的Test3本应该过的。之前也是很久没有刷HackerRank了。这里的提交方式和HackerRank的很相似。好处是可以用自己的编辑器来做题,相比于LeetCode中的编辑器更好一点,之前用LeetCode的Vim编辑模式老是错误地显示光标模式。不过这次因为用例不知道怎么用Vim调,所以暂时用了CodeRunner来写的。
Read more »

龟速爬天梯

Posted on 2019-03-10   |   Updated on 2019-03-10 | In 记录 | | Visitors

好激动,第一次离大神这么近

像每个周日一样,9点半起来,然后点了外卖,整理了一下最近的笔记。然后开始等待LeetCode Contest的到来。这周的题确实相对来说比较简单,做着做着发现到了最后一题。然后最后一题也只有Medium难度。感觉还没有Q3难,用了递归就做出来了。

Read more »

波义尔摩尔投票算法(Boyer-Moore Voting Algorithm)

Posted on 2018-09-02   |   Updated on 2018-12-25 | In 算法 | | Visitors

简介

The Boyer–Moore majority vote algorithm is an algorithm for finding the majority of a sequence of elements using linear time and constant space. It is named after Robert S. Boyer and J Strother Moore, who published it in 1981,[1] and is a prototypical example of a streaming algorithm.

Read more »

记一次淘宝接口sign签名破解

Posted on 2018-12-07   |   Updated on 2019-04-06 | In 逆向工程 | | Visitors

淘宝H5页面接口Sign签名破解

前言:由于公司业务需求,需要显示淘宝商品详情页面的图文详情部分。之前原业务逻辑是根据https://world.taobao.com/item/{num_iid}.htm,在得到html文本后全量通过图片前缀名如https://img.alicdn.com/imgextra进行抓取,返回给客户端。

Read more »

《Web API 的设计与开发》读后总结

Posted on 2018-11-26   |   Updated on 2019-02-21 | In Web | | Visitors

前言

此书为[日]水野贵明著,之前已经通读了一遍,收获不少,为了复习与总结,这里便整理一份笔记,以便忘记的时候查找。

Read more »

工作中项目优化小记

Posted on 2018-11-14   |   Updated on 2018-12-25 | In Project | | Visitors

前言

博主目前接手了一个项目,该项目代码从某马微店那里买来,社交金融相关。这个项目的代码可以说是逻辑混乱,毫无可重用性,而且又无文档,git message中一堆毫无用处的“update”,PEP8规范?不存在的。使得我每日游走在被代码劝退的边缘。
Read more »

剑指Offer

Posted on 2018-08-29   |   Updated on 2020-11-05 | In 算法 | | Visitors

2. 实现Singleton模式

使用__new__控制实例创建过程

1
2
3
4
5
6
7
8
9
class Singleton:
_instance = None
def __new__(cls, *args, **kw):
if not cls._instance:
cls._instance = super().__new__(cls)
return cls._instance

class MyClass(Singleton):
pass
Read more »

矩阵中单词的路径,很多人都错了

Posted on 2019-03-23   |   Updated on 2019-03-23 | In 算法 | | Visitors

刷过《剑指Offer》的同学,想必都会对这道题有印象,但是如果你之前是在牛客网或者AcWing其他的网站做这道题,那么即便AC通过了所有的测试,你的答案也可能是错误的。我自己之前也是被这个答案误导过,下面我来详细地解释一下自己曾经写过的错误代码,以免以后再次犯同样的错误。

Read more »

约瑟夫环问题(Josephus problem)

Posted on 2018-09-06   |   Updated on 2019-02-15 | In 算法 | | Visitors

问题:0,1,…,n-1这n个数字排成一个圆圈,从数字0开始,每次从这个圆圈里删除第m个数字。求这个圆圈里剩下的最后一个数字。

Read more »

LeetCode算法题整理(数组篇)Array

Posted on 2068-08-12 | In 算法 | | Visitors

26. Remove Duplicates from Sorted Array

删除排序数组中重复的元素, 在原数组上操作,返回一个长度,标识前n个元素为目标数组。原题

Read more »

LeetCode算法题整理(栈篇)Stack

Posted on 2019-04-07   |   Updated on 2021-07-30 | In 算法 | | Visitors

1021. Remove Outermost Parentheses

删除最外层的括号。原题

1
2
3
4
5
6
7
8
9
10
Input: "(()())(())"
Output: "()()()"
The input string is "(()())(())", with primitive decomposition "(()())" + "(())".
After removing outer parentheses of each part, this is "()()" + "()" = "()()()".
Input: "(()())(())(()(()))"
Output: "()()()()(())"
The input string is "(()())(())(()(()))", with primitive decomposition "(()())" + "(())" + "(()(()))".
After removing outer parentheses of each part, this is "()()" + "()" + "()(())" = "()()()()(())".
Input: "()()"
Output: ""
Read more »

LeetCode算法题整理(哈希篇)hashtable

Posted on 2019-02-01   |   Updated on 2022-11-28 | In 算法 | | Visitors

1. Two Sum

给定一个数组,找出数组两个元素相加为目标值,假定只有唯一解。原题

1
2
3
Given nums = [2, 7, 11, 15], target = 9,
Because nums[0] + nums[1] = 2 + 7 = 9,
return [0, 1].
Read more »
123下一页
xiaoliji

xiaoliji

38 posts
12 categories
33 tags
GitHub HackerRank LeetCode 简书
© 2023 xiaoliji
本站访客数:
Powered by Hexo
Theme - NexT.Mist
博客全站共232.9k字