Tag: 算法与数据结构基础


  1. 每周一算法2017.12.22

    Baseball Game You’re now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Integer (one round’s score): Directly represents the number of points you get in this round. “+” (one round’s score…

    算法与数据结构基础继续阅读

  2. 每周一算法2017.12.15

    1-bit and 2-bit Characters We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). Now given a string represented by several bits. Return whether the las…

    算法与数据结构基础继续阅读

  3. 每周一算法2017.12.8

    Self Dividing Numbers A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. Also, a self-dividing number is not allowed t…

    算法与数据结构基础继续阅读

  4. 每周一算法2017.12.1

    Move Zeroes Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note: 1. You must do this in-place without making a copy of the array. 2. Minimize the tot…

    算法与数据结构基础继续阅读

  5. 每周一算法2017.11.3

    Pascal's Triangle 描述: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5, Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ] 中文: 给定一个数字,生成行数为这个数字的杨辉三角 分析: 1 每行开头结尾都为1。 2 每个数等于它上方两数之…

    算法与数据结构基础继续阅读

  6. 每周一算法2017.11.24

    Longest Harmonious Subsequence We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an integer array, you need to find the length of its longest harmonious subsequen…

    算法与数据结构基础继续阅读

  7. 每周一算法2017.11.17

    TWO SUM Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. 中文: 给定一个整型数组,找出能相加起来等于一个特…

    算法与数据结构基础继续阅读