Description

Jump Game

Given an array of non-negative integers, you are initially positioned at the first index of the array.

Each element in the array represents your maximum jump length at that position.

Determine if you are able to reach the last index.

Example 1:

Input: [2,3,1,1,4]
Output: true
Explanation: Jump 1 step from index 0 to 1, then 3 steps to the last index.

Example 2:

Input: [3,2,1,0,4]
Output: false
Explanation: You will always arrive at index 3 no matter what. Its maximum
             jump length is 0, which makes it impossible to reach the last index.

Description

Spiral Matrix

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.

Example 1:

Input:
[
 [ 1, 2, 3 ],
 [ 4, 5, 6 ],
 [ 7, 8, 9 ]
]
Output: [1,2,3,6,9,8,7,4,5]

Example 2:

Input:
[
  [1, 2, 3, 4],
  [5, 6, 7, 8],
  [9,10,11,12]
]
Output: [1,2,3,4,8,12,11,10,9,5,6,7]

配置文件

在游戏工程中,通常有大量配置是由策划提供,再转换成程序方便读取的格式添加到工程中。

在我参与的Cocos2dx-Lua工程中,策划通常在Excel中配置,再通过脚本转换为Lua-Table的文件。

比如常见的道具表转换后:

Description

Unique Paths

A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).

The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked ‘Finish’ in the diagram below).

How many possible unique paths are there?

govendor

go vendor 是 go 1.6 官方正式引入的包管理方式。

其基本思路是,将引用的外部包的源代码放在当前工程的vendor目录下面,go 编译时会优先从vendor目录寻找依赖关系。

Author's picture

SelFree

城市永远年轻,而我们终将老去

Programer

ChengDu