Skip to content
the poor coder

Home / Author

Poor Man

2,994 posts
2021

Leetcode - Unique Morse Code Words Solution

International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as follows: "a" maps to ".-", "b" maps to "-...", "c" maps to "-.-.", and so on. For convenience, the full…

leetcodestring1 min read
2021

Leetcode - Custom Sort String Solution

S and T are strings composed of lowercase letters. In S, no letter occurs more than once. S was sorted in some custom order previously. We want to permute the characters of T so that they match the order that S was…

leetcodestring1 min read
2021

Leetcode - Jewels and Stones Solution

You're given strings jewels representing the types of stones that are jewels, and stones representing the stones you have. Each character in stones is a type of stone you have. You want to know how many of the stones…

2021

Leetcode - Asteroid Collision Solution

We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning…

leetcodestack2 min read
2021

Leetcode - Self Dividing Numbers Solution

A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0. Also, a self-dividing number is not…

leetcodeMath1 min read
2021

Leetcode - Baseball Game Solution

You are keeping score for a baseball game with strange rules. The game consists of several rounds, where the scores of past rounds may affect future rounds' scores. At the beginning of the game, you start with an empty…

leetcodestack3 min read
2021

Leetcode - Detect Capital Solution

We define the usage of capitals in a word to be right when one of the following cases holds: All letters in this word are capitals, like "USA". All letters in this word are not capitals, like "leetcode". Only the first…

leetcodestring1 min read
2021

Leetcode - Ransom Note Solution

Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magazines ; otherwise, it will…

leetcodestring1 min read
2021

Leetcode - Design Twitter Solution

Design a simplified version of Twitter where users can post tweets, follow/unfollow another user, and is able to see the 10 most recent tweets in the user's news feed. Implement the Twitter class: Twitter() Initializes…

ESC