Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 13b5534

Browse files
author
Shuo
authored
Merge pull request #285 from openset/develop
Add: README
2 parents 55ecdad + d42bd89 commit 13b5534

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

‎problems/bold-words-in-string/README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
1-
## 758. Bold Words in String
1+
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
2+
<!--+----------------------------------------------------------------------+-->
3+
<!--|@author Openset <openset.wang@gmail.com> |-->
4+
<!--|@link https://github.com/openset |-->
5+
<!--|@home https://github.com/openset/leetcode |-->
6+
<!--+----------------------------------------------------------------------+-->
27

8+
## 758. Bold Words in String (Easy)
9+
10+
11+
12+
### Related Topics
13+
[[String](https://github.com/openset/leetcode/tree/master/tag/string/README.md)]
14+
15+
### Hints
16+
1. First, determine which letters are bold and store that information in mask[i] = if i-th character is bold.
17+
Then, insert the tags at the beginning and end of groups. The start of a group is if and only if (mask[i] and (i == 0 or not mask[i-1])), and the end of a group is similar.

‎problems/find-permutation/README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,38 @@
1-
## 484. Find Permutation
1+
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
2+
<!--+----------------------------------------------------------------------+-->
3+
<!--|@author Openset <openset.wang@gmail.com> |-->
4+
<!--|@link https://github.com/openset |-->
5+
<!--|@home https://github.com/openset/leetcode |-->
6+
<!--+----------------------------------------------------------------------+-->
27

8+
## 484. Find Permutation (Medium)
9+
10+
<p>
11+
By now, you are given a <b>secret signature</b> consisting of character 'D' and 'I'. 'D' represents a decreasing relationship between two numbers, 'I' represents an increasing relationship between two numbers. And our <b>secret signature</b> was constructed by a special integer array, which contains uniquely all the different number from 1 to n (n is the length of the secret signature plus 1). For example, the secret signature "DI" can be constructed by array [2,1,3] or [3,1,2], but won't be constructed by array [3,2,4] or [2,1,3,4], which are both illegal constructing special string that can't represent the "DI" <b>secret signature</b>.
12+
</p>
13+
14+
<p>
15+
On the other hand, now your job is to find the lexicographically smallest permutation of [1, 2, ... n] could refer to the given <b>secret signature</b> in the input.
16+
</p>
17+
18+
<p><b>Example 1:</b><br />
19+
<pre><b>Input:</b> "I"
20+
<b>Output:</b> [1,2]
21+
<b>Explanation:</b> [1,2] is the only legal initial spectial string can construct secret signature "I", where the number 1 and 2 construct an increasing relationship.
22+
</pre>
23+
</p>
24+
25+
<p><b>Example 2:</b><br />
26+
<pre><b>Input:</b> "DI"
27+
<b>Output:</b> [2,1,3]
28+
<b>Explanation:</b> Both [2,1,3] and [3,1,2] can construct the secret signature "DI", </br>but since we want to find the one with the smallest lexicographical permutation, you need to output [2,1,3]
29+
</pre>
30+
</p>
31+
32+
<p><b>Note:</b>
33+
<li>The input string will only contain the character 'D' and 'I'.</li>
34+
<li>The length of input string is a positive integer and will not exceed 10,000</li>
35+
</p>
36+
37+
### Related Topics
38+
[[Greedy](https://github.com/openset/leetcode/tree/master/tag/greedy/README.md)]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /