chapter9-tree-algorithm Posted on 2020-02-23 | In leetcode | | Visitors: ℃ Words count in article: 7.1k | Reading time ≈ 33 chapter9-tree-algorithm[TOC] Read more »
chapter8-dual-pointer-algorithm Posted on 2020-02-22 | In leetcode | | Visitors: ℃ Words count in article: 1.3k | Reading time ≈ 6 chapter8-dual-pointer-algorithm[TOC] Read more »
chapter7-greedy-algorithm Posted on 2020-02-21 | In leetcode | | Visitors: ℃ Words count in article: 2.3k | Reading time ≈ 10 chapter7-greedy-algorithm[TOC] 贪心思想1. 分配饼干Leetcode / 力扣 12345678910111213def findContentChildren(): g, s = [ 1, 2, 3 ], [ 1, 1 ] # 由题意 “目标是尽可能满足越多数量的孩子” # 而饼干是有限的,所以首先满足胃口小的孩子,这样才能,尽可能满足较多数量的孩子 cnt = 0 g.sort() s.sort() for n in s: if n >= g[cnt]: cnt += 1 if cnt >= len(g): break print(cnt)findContentChildren() Read more »
chapter6-stack-and-queue-algorithm Posted on 2020-02-20 | In leetcode | | Visitors: ℃ Words count in article: 1.4k | Reading time ≈ 6 chapter6-stack-and-queue-algorithm栈和队列算法[TOC] Read more »
chapter5-bit-operation-algorithm Posted on 2020-02-20 | In leetcode | | Visitors: ℃ Words count in article: 1.5k | Reading time ≈ 6 chapter5-bit-operation-algorith[TOC] Read more »