03 2019 档案

摘要:Given a balanced parentheses string , compute the score of the string based on the following rule: has score 1 has score , where A and B are balanced 阅读全文
posted @ 2019-03-31 23:55 Grandyang 阅读(4119) 评论(0) 推荐(0) 编辑
摘要:In an exam room, there are N seats in a single row, numbered 0, 1, 2, ..., N-1. When a student enters the room, they must sit in the seat that maximiz 阅读全文
posted @ 2019-03-28 22:59 Grandyang 阅读(5096) 评论(2) 推荐(0) 编辑
摘要:cars are going to the same destination along a one lane road. The destination is miles away. Each car has a constant speed (in miles per hour), and in 阅读全文
posted @ 2019-03-15 23:15 Grandyang 阅读(3848) 评论(0) 推荐(1) 编辑
摘要:Let's call an array a mountain if the following properties hold: There exists some Given an array that is definitely a mountain, return any such that 阅读全文
posted @ 2019-03-13 23:57 Grandyang 阅读(3223) 评论(0) 推荐(0) 编辑
摘要:In a group of N people (labelled `0, 1, 2, ..., N-1`), each person has different amounts of money, and different levels of quietness. For convenience, 阅读全文
posted @ 2019-03-11 23:26 Grandyang 阅读(2036) 评论(0) 推荐(0) 编辑
摘要:In a row of seats, 1 represents a person sitting in that seat, and 0 represents that the seat is empty. There is at least one empty seat, and at least 阅读全文
posted @ 2019-03-09 23:54 Grandyang 阅读(5826) 评论(2) 推荐(1) 编辑
摘要:There are piles of stones arranged in a row. The th pile has stones. A move consists of merging exactly consecutive piles into one pile, and the cost 阅读全文
posted @ 2019-03-07 23:35 Grandyang 阅读(5953) 评论(9) 推荐(0) 编辑
摘要:We have a string S of lowercase letters, and an integer array shifts. Call the shift of a letter, the next letter in the alphabet, (wrapping around so 阅读全文
posted @ 2019-03-05 22:06 Grandyang 阅读(2229) 评论(0) 推荐(0) 编辑
摘要:Alice has a hand of cards, given as an array of integers. Now she wants to rearrange the cards into groups so that each group is size W, and consists 阅读全文
posted @ 2019-03-03 23:46 Grandyang 阅读(3357) 评论(0) 推荐(0) 编辑
摘要:Let's call any (contiguous) subarray B (of A) a mountain if the following properties hold: B.length >= 3 There exists some 0 < i < B.length - 1 such t 阅读全文
posted @ 2019-03-01 23:49 Grandyang 阅读(3679) 评论(0) 推荐(0) 编辑

Fork me on GitHub