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
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"] …

Valid Parentheses - String - Easy - LeetCode
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. …

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…

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 …

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…

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 (…

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…

Valid Palindrome - String - Easy - LeetCode
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For…

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

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…

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

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…

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…

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…

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