Category: algorithms
Given two strings s1 and s2, determine if s1 is a subsequence of s2. A string a is a subsequence of another string b if you can delete some …
Given a string s consisting only of 1s and 0s, you can delete any two adjacent letters if they are different. Return the length of the smallest string that …
Given a list of integers, find the largest product of two distinct elements. Example 1 Input nums = Output 35 Explanation 35 is the largest product that can be …
Penny for Your Thoughts Given a positive integer n representing the amount of cents you have, return the formatted currency amount. For example, given n = 123456, return “1,234.56”. …
Given a binary tree root, return the sum of each of the diagonals in the tree starting from the top to bottom right. For example, given 1 / \ …