04 2018 档案

摘要:On a horizontal number line, we have gas stations at positions stations[0], stations[1], ..., stations[N-1], where N = stations.length. Now, we add K  阅读全文
posted @ 2018-04-28 23:59 Grandyang 阅读(7120) 评论(6) 推荐(1) 编辑
摘要:On an 2 x 3 board, there are five tiles labeled from 1 to 5, and an empty square represented by 0. A move consists of choosing 0 and a 4-directionally 阅读全文
posted @ 2018-04-26 23:31 Grandyang 阅读(7960) 评论(2) 推荐(0) 编辑
摘要:Given an expression such as expression = "e + 8 - a + 5" and an evaluation map such as {"e": 1} (given in terms of evalvars = ["e"] and evalints = [1] 阅读全文
posted @ 2018-04-24 23:22 Grandyang 阅读(5814) 评论(3) 推荐(0) 编辑
摘要:You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in Sis a type of stone 阅读全文
posted @ 2018-04-22 23:37 Grandyang 阅读(4588) 评论(0) 推荐(0) 编辑
摘要:话说博主在写 Max Chunks To Make Sorted II 这篇帖子的解法四时,写到使用单调栈Monotone Stack的解法时,突然脑中触电一般,想起了之前曾经在此贴 LeetCode All in One 题目讲解汇总(持续更新中...) 的留言区中说要写单调栈的总结帖,当时答应了 阅读全文
posted @ 2018-04-20 07:31 Grandyang 阅读(40435) 评论(12) 推荐(2) 编辑
摘要:Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses ), the plus + or 阅读全文
posted @ 2018-04-18 11:58 Grandyang 阅读(26777) 评论(11) 推荐(1) 编辑
摘要:This question is the same as "Max Chunks to Make Sorted" except the integers of the given array are not necessarily distinct, the input array could be 阅读全文
posted @ 2018-04-15 23:51 Grandyang 阅读(7261) 评论(2) 推荐(1) 编辑
摘要: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 individuall 阅读全文
posted @ 2018-04-13 21:05 Grandyang 阅读(5406) 评论(1) 推荐(0) 编辑
摘要:Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same. If possible, output 阅读全文
posted @ 2018-04-11 23:40 Grandyang 阅读(12061) 评论(7) 推荐(0) 编辑
摘要:Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every ele 阅读全文
posted @ 2018-04-08 05:38 Grandyang 阅读(11418) 评论(0) 推荐(1) 编辑
摘要:A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element. Now given an M x N matrix, return True if and only if the m 阅读全文
posted @ 2018-04-06 23:42 Grandyang 阅读(7450) 评论(0) 推荐(0) 编辑
摘要:N couples sit in 2N seats arranged in a row and want to hold hands. We want to know the minimum number of swaps so that every couple is sitting side b 阅读全文
posted @ 2018-04-04 12:31 Grandyang 阅读(6690) 评论(5) 推荐(2) 编辑
摘要:在iOS开发中,按钮图标可以放三种大小,常见的是22x22,44x44,66x66,一般来说我们可以在PS中做好图片后,再分别导出三种大小的图标,但是每次要修改图片的大小,操作比较繁琐。这里博主推荐一种使用命令行来快速对图片的大小进行转换,比如我们用PS做好了图以后,先导出66x66大小的图片,命名 阅读全文
posted @ 2018-04-01 06:16 Grandyang 阅读(1184) 评论(0) 推荐(0) 编辑

Fork me on GitHub