Tag: C++ coding exercise
Given an integer number n, return the difference between the product of its digits and the sum of its digits. Example 1: Input: n = 234 Output: 15 Explanation: …
Tic-tac-toe is played by two players A and B on a 3 x 3 grid. Here are the rules of Tic-Tac-Toe: Players take turns placing characters into empty squares …
Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order. Return the intersection of these two interval lists. (Formally, a closed interval …
Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Input: Output: Explanation: 0,1,2 form a continuous range; 4,5 form a continuous range. Example …
Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Input: Output: 2 Explanation: is the longest contiguous …