Archive: 2019/5

Stacks: Balanced Brackets

Stacks: Balanced BracketsA bracket is considered to be any one of the following characters: (, ), {, }, [, or ]. Two brackets are considered to be a matched pair if the an opening bracket (i.e., (, [,

Hash Tables: Ransom Note

Hash Tables: Ransom NoteA kidnapper wrote a ransom note but is worried it will be traced back to him. He found a magazine and wants to know if he can cut out whole words from it and use them to create

Strings: Making Anagrams

Strings: Making AnagramsAlice is taking a cryptography class and finding anagrams to be very useful. We consider two strings to be anagrams of each other if the first string’s letters can be rearrange

Regex - [.*] 와 [.*?] 의 차이

Regex - [.*] 와 [.*?] 의 차이문서에서 [ ] 안에 들어있는 문자열을 괄호와 함께 모두 지워버려야 하는 상황이 생겼다. Regex 를 어떻게 쓰면 이 문제를 해결할 수 있을까? 우선 예시 문장을 하나 만들어 보았다. 1sent = "Hello, this is an example sentence [for trying out regex gramm