杨帆博客

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


  • 首页

  • 标签

  • 归档

  • 搜索

Transpose-Matrix

发表于 2018-07-14 | 更新于: 2018-08-22

题目地址

LeetCode#867 Transpose Matrix

题目描述

  Given a matrix A, return the transpose of A.

  The transpose of a matrix is the matrix flipped over it’s main diagonal, switching the row and column indices of the matrix.

阅读全文 »

To-Lower-Case

发表于 2018-07-13 | 更新于: 2018-08-22

题目地址

LeetCode#709 To Lower Case

题目描述

  Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.

阅读全文 »

Number-of-Lines-To-Write-String

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

题目地址

LeetCode#806 Number of Lines To Write String

题目描述

  We are to write the letters of a given string S, from left to right into lines. Each line has maximum width 100 units, and if writing a letter would cause the width of the line to exceed 100 units, it is written on the next line. We are given an array widths, an array where widths[0] is the width of ‘a’, widths[1] is the width of ‘b’, …, and widths[25] is the width of ‘z’.

  Now answer two questions: how many lines have at least one character from S, and what is the width used by the last such line? Return your answer as an integer list of length 2.

阅读全文 »

Score-After-Flipping-Matrix

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

题目地址

LeetCode#861 Score After Flipping Matrix

题目描述

  We have a two dimensional matrix A where each value is 0 or 1.

  A move consists of choosing any row or column, and toggling each value in that row or column: changing all 0s to 1s, and all 1s to 0s.

  After making any number of moves, every row of this matrix is interpreted as a binary number, and the score of the matrix is the sum of these numbers.

  Return the highest possible score.

阅读全文 »

All-Paths-From-Source-to-Target

发表于 2018-06-30 | 更新于: 2018-08-22

题目地址

LeetCode#797 All Paths From Source to Target

题目描述

  Given a directed, acyclic graph of N nodes. Find all possible paths from node 0 to node N-1, and return them in any order.

  The graph is given as follows: the nodes are 0, 1, …, graph.length - 1. graph[i] is a list of all nodes j for which the edge (i, j) exists.

阅读全文 »
123…46
KsGin

KsGin

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

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