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

Longest Common Prefix - String - Easy - LeetCode
Featured

Longest Common Prefix - String - Easy - LeetCode

Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "".   Example 1: Input: ["flower","flow","flight"]

1 min read5 Jun 2020
Read article
Valid Parentheses - String - Easy - LeetCode

Valid Parentheses - String - Easy - LeetCode

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

2 min4 Jun
Implement strStr() - String - Easy - LeetCode

Implement strStr() - String - Easy - LeetCode

Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of hays

2 min4 Jun
Count and Say - String - Easy - LeetCode

Count and Say - String - Easy - LeetCode

The count-and-say sequence is the sequence of integers with the first five terms as following: 1.     1

2 min4 Jun
Reverse Vowels of a String - String - Easy - LeetCode

Reverse Vowels of a String - String - Easy - LeetCode

Write a function that takes a string as input and reverse only the vowels of a string.   Example 1: Input: "hell

1 min4 Jun
Length of Last Word - String - Easy - LeetCode

Length of Last Word - String - Easy - LeetCode

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word (

1 min4 Jun
Add Binary - String - Easy - LeetCode

Add Binary - String - Easy - LeetCode

Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contain onl

2 min4 Jun
Valid Palindrome - String - Easy - LeetCode

Valid Palindrome - String - Easy - LeetCode

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For

1 min4 Jun
Ransom Note

Ransom Note

Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function tha

1 min4 Jun
First Unique Character in a String

First Unique Character in a String

Given a string, find the first non-repeating character in it and return its index. If it doesn't exist, return -1. Exam

1 min4 Jun
Add Strings

Add Strings

Given two non-negative integers, num1 and num2 represented as a string, return the sum of num1 and num2.   Note:

1 min4 Jun
Number of Segments in a String

Number of Segments in a String

Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters

1 min31 May
Consecutive Characters

Consecutive Characters

Given a string s, the power of the string is the maximum length of a non-empty substring that contains only one unique c

2 min31 May
Check If a Word Occurs As a Prefix of Any Word in a Sentence

Check If a Word Occurs As a Prefix of Any Word in a Sentence

Given a sentence that consists of some words separated by a single space, and a searchWord. You have to check if search

3 min30 May
Reverse String

Reverse String

Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate ex

1 min25 May