Tag: C++ string
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 …
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”. …
You are given a string s that consists of lower case English letters and brackets. Reverse the strings in each pair of matching parentheses, starting from the innermost one. …
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: We can use the …
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 result equals B. Example …