Description

Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.

The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-based.

You may assume that each input would have exactly one solution.

Input: numbers={2, 7, 11, 15}, target=9
Output: index1=1, index2=2

The original problem is here.

Description

Given a non-empty array of integers, return the k most frequent elements.

For example,
Given [1,1,1,2,2,3] and k = 2, return [1,2].
Note:

• You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
• Your algorithm’s time complexity must be better than O(n log n), where n is the array’s size.

The original problem is here.

Description

Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.

This is case sensitive, for example “Aa” is not considered a palindrome here.

Note:
Assume the length of given string will not exceed 1,010.

Example:

The original problem is here.

Description

Given an 2D board, count how many different battleships are in it. The battleships are represented with ‘X’s, empty slots are represented with ‘.’s. You may assume the following rules:

You receive a valid board, made of only battleships or empty slots.
Battleships can only be placed horizontally or vertically. In other words, they can only be made of the shape 1xN (1 row, N columns) or Nx1 (N rows, 1 column), where N can be of any size.
At least one horizontal or vertical cell separates between two battleships - there are no adjacent battleships.
Example:

X..X
…X
…X

In the above board there are 2 battleships.

Invalid Example:

…X
XXXX
…X

This is an invalid board that you will not receive - as battleships will always have a cell separating between them.

The original problem is here.

Description

A magical string S consists of only ‘1’ and ‘2’ and obeys the following rules:

The string S is magical because concatenating the number of contiguous occurrences of characters ‘1’ and ‘2’ generates the string S itself.

The first few elements of string S is the following: S = “1221121221221121122……”

If we group the consecutive ‘1’s and ‘2’s in S, it will be:

1 22 11 2 1 22 1 22 11 2 11 22 ……

and the occurrences of ‘1’s or ‘2’s in each group are:

1 2 2 1 1 2 1 2 2 1 2 2 ……

You can see that the occurrence sequence above is the S itself.

Given an integer N as input, return the number of ‘1’s in the first N number in the magical string S.

Note: N will not exceed 100,000.

Example 1:

The original problem is here.

Description

You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely surrounded by water, and there is exactly one island (i.e., one or more connected land cells). The island doesn’t have “lakes” (water inside that isn’t connected to the water around the island). One cell is a square with side length 1. The grid is rectangular, width and height don’t exceed 100. Determine the perimeter of the island.

Example:

[[0,1,0,0],
[1,1,1,0],
[0,1,0,0],
[1,1,0,0]]

The original problem is here.

Description

The Hamming distance between two integers is the number of positions at which the corresponding bits are different.

Given two integers x and y, calculate the Hamming distance.

Note:
0 ≤ x, y < 2^31.

The original problem is here.

问题

JVM初始分配的内存由-Xms指定，默认是物理内存的1/64；
JVM最大分配的内存由-Xmx指定，默认是物理内存的1/4。

论文信息

• 作者：Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, Koray Kavukcuoglu
• 发表日期： 2016
• 论文链接：https://arxiv.org/pdf/1609.03499.pdf

简介

WaveNet 是一种用于生成原始语音的深层神经网络，基于WaveNet的语音合成比目前性能最好的参数式语音合成和拼接式语音合成有更好的主观评分。

WaveNet还可以生成美妙动听的音乐，此外还可以作为区分式模型应用到音子识别。

• 验证了WaveNet可以生成语音信号，并且语音的主观评分之高在TTS领域内是前所有未有的。
• 为了更好地处理音频生成过程中的长跨度的时序依赖，基于扩展级联卷积开发了新的网络结构。
• 验证了在不同说话人标记条件下，单个模型可以生成不同的声音。
• 文中的网络结构在小的语音识别数据库中具有很好的效果，并且在生成其他音频例如音乐时具有不错的效果。

WaveNet

Dilated Causal Convolutions

WaveNet主要由Causal Convolution组成，下图是由多个Causal Convolutional Layers堆叠形成的网络。

MacOS操作系统使用入门介绍

快捷键

• 全选：commend ＋ a
• 复制：commend ＋ c
• 粘贴：commend ＋ v
• 剪切：无（粘贴时 alt＋commend＋v可以模拟）
• 保存：commend ＋ s
• 退出：commend ＋ q
• 全屏：control ＋ commend ＋ f（退出全屏也是）
• 打开文件：commend ＋ o
• 输入法切换：commend ＋ 空格
• spotlight：control ＋ 空格
• Alfred：alt ＋ 空格