Description: Given a string containing digits from 2 to 9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digit to…
Tag: leetcode
Palindrome Problems Summary
Palindrome problems 1. Basic algorithm to check palindrome This section presents methods for checking if a string is a palindrome: 1.1 Check if a substring is palindrome at i and expand it….
Find the first and last occurrence in an array
To find the first occurrence of a target value in a sorted array using binary search, the algorithm needs to be slightly modified from the standard binary search. The goal is to…
Power of 2[Leetcode231]
You can check if a number is a power of 2 using recursion in Java by repeatedly dividing the number by 2 and checking if it eventually becomes 1. If it does,…