1,724 articles across 10 categories

Stories, Tutorials & Life Tips

Deep dives on coding, health, recipes, travel and everything in between.

πŸ“ Explore Reading Paths

Follow curated journeys from beginner to expert

Valid Palindrome II
Featured

Valid Palindrome II

Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome.   Example 1: Input: "aba" Output: True   Example 2: Input: "abca" Ou…

1 min read11 May 2020
Read article
Repeated String Match

Repeated String Match

Given two strings A and B, find the minimum number of times A has to be repeated such that B is a substring of it. If no…

1 min10 May
Count Binary Substrings

Count Binary Substrings

Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all…

1 min10 May
To Lower Case

To Lower Case

Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Example 1: …

1 min8 May
Rotated Digits

Rotated Digits

X is a good number if after rotating each digit individually by 180 degrees, we get a valid number that is different fro…

1 min8 May
Unique Morse Code Words

Unique Morse Code Words

International Morse Code defines a standard encoding where each letter is mapped to a series of dots and dashes, as foll…

2 min8 May
Most Common Word

Most Common Word

Given a paragraph and a list of banned words, return the most frequent word that is not in the list of banned words.&nbs…

2 min7 May
Goat Latin

Goat Latin

A sentence S is given, composed of words separated by spaces. Each word consists of lowercase and uppercase letters only…

2 min7 May
Buddy Strings

Buddy Strings

Given two strings A and B of lowercase letters, return true if and only if we can swap two letters in A so that the resu…

1 min7 May
Reverse Only Letters

Reverse Only Letters

Given a string S, return the "reversed" string where all characters that are not a letter stay in the same place, and al…

1 min6 May
Long Pressed Name

Long Pressed Name

Your friend is typing his name into a keyboard.  Sometimes, when typing a character c, the key might get long press…

1 min6 May
Unique Email Addresses

Unique Email Addresses

Every email consists of a local name and a domain name, separated by the @ sign. For example, in alice@leetcode.com, al…

2 min5 May
Reorder Data in Log Files

Reorder Data in Log Files

You have an array of logs.  Each log is a space-delimited string of words. For each log, the first word in each lo…

2 min5 May
Greatest Common Divisor of Strings

Greatest Common Divisor of Strings

For strings S and T, we say "T divides S" if and only if S = T + ... + T  (T concatenated with itself 1 or more tim…

1 min5 May
Defanging an IP Address

Defanging an IP Address

Given a valid (IPv4) IP address, return a defanged version of that IP address. A defanged IP address replaces every per…

1 min4 May
Blog β€” Page 30 | AskGif