Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion problems/android-unlock-patterns/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
## 351. Android Unlock Patterns
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
<!--+----------------------------------------------------------------------+-->
<!--|@author Openset <openset.wang@gmail.com> |-->
<!--|@link https://github.com/openset |-->
<!--|@home https://github.com/openset/leetcode |-->
<!--+----------------------------------------------------------------------+-->

## 351. Android Unlock Patterns (Medium)



### Related Topics
[[Dynamic Programming](https://github.com/openset/leetcode/tree/master/tag/dynamic-programming/README.md)]
[[Backtracking](https://github.com/openset/leetcode/tree/master/tag/backtracking/README.md)]
52 changes: 51 additions & 1 deletion problems/design-compressed-string-iterator/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,52 @@
## 604. Design Compressed String Iterator
<!--|This file generated by command(leetcode description); DO NOT EDIT. |-->
<!--+----------------------------------------------------------------------+-->
<!--|@author Openset <openset.wang@gmail.com> |-->
<!--|@link https://github.com/openset |-->
<!--|@home https://github.com/openset/leetcode |-->
<!--+----------------------------------------------------------------------+-->

## 604. Design Compressed String Iterator (Easy)

<p>
Design and implement a data structure for a compressed string iterator. It should support the following operations: <code>next</code> and <code>hasNext</code>.
</p>

<p>
The given compressed string will be in the form of each letter followed by a positive integer representing the number of this letter existing in the original uncompressed string.
</p>

<p>
<code>next()</code> - if the original string still has uncompressed characters, return the next letter; Otherwise return a white space.<br>
<code>hasNext()</code> - Judge whether there is any letter needs to be uncompressed.
</p>

<p>
<b>Note:</b><br />
Please remember to <b>RESET</b> your class variables declared in StringIterator, as static/class variables are <b>persisted across multiple test cases</b>. Please see <a href="https://leetcode.com/faq/#different-output">here</a> for more details.
</p>


<p><b>Example:</b>
<pre>
StringIterator iterator = new StringIterator("L1e2t1C1o1d1e1");

iterator.next(); // return 'L'
iterator.next(); // return 'e'
iterator.next(); // return 'e'
iterator.next(); // return 't'
iterator.next(); // return 'C'
iterator.next(); // return 'o'
iterator.next(); // return 'd'
iterator.hasNext(); // return true
iterator.next(); // return 'e'
iterator.hasNext(); // return false
iterator.next(); // return ' '
</pre>
</p>

### Related Topics
[[Design](https://github.com/openset/leetcode/tree/master/tag/design/README.md)]

### Similar Questions
1. [LRU Cache](https://github.com/openset/leetcode/tree/master/problems/lru-cache) (Hard)
1. [String Compression](https://github.com/openset/leetcode/tree/master/problems/string-compression) (Easy)