Snail Life

basketball dance rap


  • Home

  • Tags

  • Categories

  • Archives

  • Search

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 / 力扣

1
2
3
4
5
6
7
8
9
10
11
12
13
def 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 »
1…345…11

snail json

您心底所憧憬的事物,一定在某个维度发生

54 posts
15 categories
21 tags
RSS
GitHub E-Mail Google 知乎

Tag Cloud

  • -- thread1
  • Anaconda1
  • Optimization1
  • algorithms27
  • db22
  • github1
  • hive2
  • linux1
  • markdown1
  • python20
  • self-study1
  • site1
  • sql2
  • statistics1
  • thread3
  • vim1
  • win10快捷键1
  • 古月山风1
  • 梦想1
  • 破晓1
  • 随笔2
© 2021 snail json | Site words total count: 137.6k
Powered by Hexo
|
Theme — NexT.Mist v5.1.4
snail silly?