杨帆博客

你想开发游戏还是改变世界?


  • 首页

  • 标签

  • 归档

  • 搜索

Max-Chunks-To-Make-Sorted

发表于 2018-01-23 | 更新于: 2018-08-22

题目地址

LeetCode#769 Max Chunks To Make Sorted

题目描述

Given an array arr that is a permutation of [0, 1, ..., arr.length - 1], we split the array into some number of “chunks” (partitions), and individually sort each chunk. After concatenating them, the result equals the sorted array.

What is the most number of chunks we could have made?

阅读全文 »

Best-Time-to-Buy-and-Sell-Stock-with-Transaction-Fee

发表于 2018-01-22 | 更新于: 2018-08-22

题目地址

LeetCode#714 Best Time to Buy and Sell Stock with Transaction Fee

题目描述

Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee representing a transaction fee.

阅读全文 »

【OpenGL】5-彩色立方体

发表于 2018-01-21 | 更新于: 2018-08-22

参考教程

【中文版】第四课:彩色立方体

【英文版】Tutorial 4 : A Colored Cube

  在之前的几篇笔记中,最后的结果仅仅只是画出来一个三角形,但是真实的计算机图形怎么可能是一个三角形可以概括的。在仅支持Draw Triangle的OpenGL里,我们将学着使用三角形去构造出复杂的图形等等。在这篇笔记中,主要学会使用12个三角形去构造一个正立方体。

阅读全文 »

Min-Cost-Climbing-Stairs

发表于 2018-01-21 | 更新于: 2018-08-22

题目地址

LeetCode#746 Min Cost Climbing Stairs

题目描述

On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).

Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of the floor, and you can either start from the step with index 0, or the step with index 1.

阅读全文 »

Largest-Number-At-Least-Twice-of-Others

发表于 2018-01-20 | 更新于: 2018-08-22

题目地址

LeetCode#747 Largest Number At Least Twice of Others

题目描述

In a given integer array nums, there is always exactly one largest element.

Find whether the largest element in the array is at least twice as much as every other number in the array.

If it is, return the index of the largest element, otherwise return -1.

阅读全文 »
1…363738…46
KsGin

KsGin

游戏程序员/计算机图形学/Unity/西山居搬砖

226 日志
16 标签
GitHub E-Mail Google Twitter
© 2018 KsGin @ 2018
0%